pub struct PluginContext {
pub document: Option<*const PdfDocument>,
pub current_node: Option<NodeId>,
pub graph: Option<*mut PdfAstGraph>,
pub config: HashMap<String, Value>,
pub shared_data: HashMap<String, Box<dyn Any + Send + Sync>>,
pub statistics: PluginStatistics,
}Expand description
Plugin execution context
Fields§
§document: Option<*const PdfDocument>§current_node: Option<NodeId>§graph: Option<*mut PdfAstGraph>§config: HashMap<String, Value>§statistics: PluginStatisticsImplementations§
Source§impl PluginContext
impl PluginContext
pub fn new() -> Self
pub fn with_document(self, document: &PdfDocument) -> Self
pub fn with_graph(self, graph: &mut PdfAstGraph) -> Self
pub fn set_config(&mut self, key: String, value: Value)
pub fn get_config(&self, key: &str) -> Option<&Value>
pub fn get_document(&self) -> Option<&PdfDocument>
pub fn get_graph_mut(&mut self) -> Option<&mut PdfAstGraph>
pub fn set_data(&mut self, key: &str, value: String)
pub fn add_warning(&mut self, message: &str)
pub fn add_error(&mut self, message: &str)
pub fn add_info(&mut self, message: String)
Trait Implementations§
Source§impl Default for PluginContext
impl Default for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
Auto Trait Implementations§
impl Freeze for PluginContext
impl !RefUnwindSafe for PluginContext
impl Unpin for PluginContext
impl !UnwindSafe for PluginContext
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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