pub struct PatternCollapse { /* private fields */ }Expand description
Collapses node labels through a regular-expression capture replacement.
Implementations§
Source§impl PatternCollapse
impl PatternCollapse
Sourcepub const DEFAULT_REPLACEMENT: &'static str = "$1"
pub const DEFAULT_REPLACEMENT: &'static str = "$1"
The Rust regex spelling for the first capture group.
Sourcepub fn new(
expression: impl AsRef<str>,
replacement: impl Into<String>,
) -> Result<Self, GraphQueryError>
pub fn new( expression: impl AsRef<str>, replacement: impl Into<String>, ) -> Result<Self, GraphQueryError>
Compiles a collapse expression with an explicit Rust regex replacement.
Sourcepub fn first_capture(
expression: impl AsRef<str>,
) -> Result<Self, GraphQueryError>
pub fn first_capture( expression: impl AsRef<str>, ) -> Result<Self, GraphQueryError>
Compiles a collapse expression that replaces a match with its first capture group.
Sourcepub fn replacement(&self) -> &str
pub fn replacement(&self) -> &str
Returns the Rust regex replacement expression.
Trait Implementations§
Source§impl Clone for PatternCollapse
impl Clone for PatternCollapse
Source§fn clone(&self) -> PatternCollapse
fn clone(&self) -> PatternCollapse
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PatternCollapse
impl RefUnwindSafe for PatternCollapse
impl Send for PatternCollapse
impl Sync for PatternCollapse
impl Unpin for PatternCollapse
impl UnwindSafe for PatternCollapse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more