Skip to main content

Transformer

Struct Transformer 

Source
pub struct Transformer<'a, M: NodeMetadata, N: NodeWithMetadata<M>, F: TransformerFeatures<M, N>> { /* private fields */ }

Implementations§

Source§

impl<'a, M: NodeMetadata, N: NodeWithMetadata<M>, F: TransformerFeatures<M, N>> Transformer<'a, M, N, F>

Source

pub fn new_in( bump: &'a Bump, features: F, atoms: &'static dyn DynAtomSet, source_text: &'a str, ) -> Self

Source

pub fn transform(&mut self, node: &mut N)

Source

pub fn has_changed(&self) -> bool

Source

pub fn bump(&self) -> &'a Bump

Source

pub fn to_source_cursor(&self, cursor: Cursor) -> SourceCursor<'a>

Source

pub fn to_source_cursors( &self, parsed: &impl ToCursors, ) -> Vec<'a, SourceCursor<'a>>

Source

pub fn to_atom<A: AtomSet + PartialEq>(&self, c: Cursor) -> A

Source

pub fn overlays(&self) -> Ref<'_, CursorOverlaySet<'a>>

Source

pub fn parse_value<T>(&self, source: &'a str) -> Vec<'a, SourceCursor<'a>>
where T: Parse<'a> + ToCursors,

Source

pub fn reset(&self)

Source

pub fn has_replacement(&self, span: impl ToSpan) -> bool

Source

pub fn clear_pending_edits(&self, span: Span) -> bool

Source

pub fn replace(&self, span: impl ToSpan, cursors: Vec<'a, SourceCursor<'a>>)

Source

pub fn delete(&self, span: impl ToSpan)

Source

pub fn insert_before( &self, anchor: SourceOffset, cursors: Vec<'a, SourceCursor<'a>>, )

Source

pub fn insert_after( &self, anchor: SourceOffset, cursors: Vec<'a, SourceCursor<'a>>, )

Source

pub fn replace_parsed<T>(&self, span: impl ToSpan, css: &str)
where T: Parse<'a> + ToCursors,

Source

pub fn commit_overlays(&self) -> Result<(), CommitError>

Auto Trait Implementations§

§

impl<'a, M, N, F> !Freeze for Transformer<'a, M, N, F>

§

impl<'a, M, N, F> !RefUnwindSafe for Transformer<'a, M, N, F>

§

impl<'a, M, N, F> !Send for Transformer<'a, M, N, F>

§

impl<'a, M, N, F> !Sync for Transformer<'a, M, N, F>

§

impl<'a, M, N, F> Unpin for Transformer<'a, M, N, F>
where F: Unpin, M: Unpin, N: Unpin,

§

impl<'a, M, N, F> !UnwindSafe for Transformer<'a, M, N, F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.