pub struct ReplacementRule { /* private fields */ }Expand description
Replacement rule used by the query-and-transform surface.
Implementations§
Source§impl ReplacementRule
impl ReplacementRule
Sourcepub fn captured_text(
capture_name: impl Into<String>,
replacement: impl Into<String>,
) -> Self
pub fn captured_text( capture_name: impl Into<String>, replacement: impl Into<String>, ) -> Self
Replaces the source text covered by links captured under capture_name.
Captured syntax links are rewritten by changing the token links inside the captured range, so all tokens outside the captured links keep their original text and order.
Sourcepub const fn substitution(rule: SubstitutionRule) -> Self
pub const fn substitution(rule: SubstitutionRule) -> Self
Applies an exact-reference substitution via LinkNetwork::apply_substitution.
Sourcepub const fn variable_substitution(rule: VariableSubstitutionRule) -> Self
pub const fn variable_substitution(rule: VariableSubstitutionRule) -> Self
Applies a variable substitution via LinkNetwork::apply_variable_substitution.
Sourcepub fn quasiquote(
capture_name: impl Into<String>,
template: QuasiquoteTemplate,
) -> Self
pub fn quasiquote( capture_name: impl Into<String>, template: QuasiquoteTemplate, ) -> Self
Replaces captured source text with a quasiquote template.
Placeholders use {{capture_name}} and are resolved from the same query
match before each replacement is applied.
Trait Implementations§
Source§impl Clone for ReplacementRule
impl Clone for ReplacementRule
Source§fn clone(&self) -> ReplacementRule
fn clone(&self) -> ReplacementRule
Returns a duplicate 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 moreSource§impl Debug for ReplacementRule
impl Debug for ReplacementRule
Source§impl PartialEq for ReplacementRule
impl PartialEq for ReplacementRule
impl Eq for ReplacementRule
impl StructuralPartialEq for ReplacementRule
Auto Trait Implementations§
impl Freeze for ReplacementRule
impl RefUnwindSafe for ReplacementRule
impl Send for ReplacementRule
impl Sync for ReplacementRule
impl Unpin for ReplacementRule
impl UnsafeUnpin for ReplacementRule
impl UnwindSafe for ReplacementRule
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.