Skip to main content

PluginContext

Struct PluginContext 

Source
pub struct PluginContext<'a> { /* private fields */ }
Expand description

Context passed to Rust plugin visitor methods and before/after hooks.

Implementations§

Source§

impl<'a> PluginContext<'a>

Source

pub fn arena(&self) -> &Arena

Source

pub fn extract_text(&self, node_id: u32) -> String

Extract all text content from a subtree (depth-first concatenation)

Source

pub fn set_data(&mut self, node_id: u32, key: &str, value: DataValue)

Source

pub fn get_data(&self, node_id: u32, key: &str) -> Option<&DataValue>

Source

pub fn set_typed_data<T: Any + Send + Sync>(&mut self, node_id: u32, value: T)

Source

pub fn get_typed_data<T: Any + Send + Sync>(&self, node_id: u32) -> Option<&T>

Source

pub fn replace_node(&mut self, node_id: u32, new_node: NewNode)

Source

pub fn remove_node(&mut self, node_id: u32)

Source

pub fn insert_before(&mut self, node_id: u32, new_node: NewNode)

Source

pub fn insert_after(&mut self, node_id: u32, new_node: NewNode)

Source

pub fn wrap_node(&mut self, node_id: u32, parent_node: NewNode)

Source

pub fn prepend_child(&mut self, node_id: u32, child_node: NewNode)

Source

pub fn append_child(&mut self, node_id: u32, child_node: NewNode)

Source

pub fn report( &mut self, message: impl Into<String>, node_id: Option<u32>, severity: Severity, )

Source

pub fn error(&mut self, message: impl Into<String>, node_id: Option<u32>)

Source

pub fn warn(&mut self, message: impl Into<String>, node_id: Option<u32>)

Auto Trait Implementations§

§

impl<'a> Freeze for PluginContext<'a>

§

impl<'a> !RefUnwindSafe for PluginContext<'a>

§

impl<'a> Send for PluginContext<'a>

§

impl<'a> Sync for PluginContext<'a>

§

impl<'a> Unpin for PluginContext<'a>

§

impl<'a> UnsafeUnpin for PluginContext<'a>

§

impl<'a> !UnwindSafe for PluginContext<'a>

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.