#[repr(C)]pub struct PluginEnv(/* private fields */);
Expand description
A companion structure, always passed as first argument of any plugin operation function, enabling the plugin to interact with the host implementation.
Implementations§
Source§impl PluginEnv
impl PluginEnv
Sourcepub fn save_output(&self, v: PluginVal) -> Result<()>
pub fn save_output(&self, v: PluginVal) -> Result<()>
Store a new plugin output.
Sourcepub fn save_outputs(&self, v: &[PluginVal]) -> Result<()>
pub fn save_outputs(&self, v: &[PluginVal]) -> Result<()>
Store all the plugin outputs.
Sourcepub fn get_connection<T>(&self, field: ConnectionField) -> Result<T>
pub fn get_connection<T>(&self, field: ConnectionField) -> Result<T>
Get a connection field.
Sourcepub fn set_connection<T>(&mut self, field: ConnectionField, v: T) -> Result<()>
pub fn set_connection<T>(&mut self, field: ConnectionField, v: T) -> Result<()>
Set a connection field.
Sourcepub fn get_recovery<'de, T>(&self, field: RecoveryField) -> Twhere
T: Deserialize<'de>,
pub fn get_recovery<'de, T>(&self, field: RecoveryField) -> Twhere
T: Deserialize<'de>,
Get a recovery field.
Sourcepub fn set_recovery<T>(&mut self, field: RecoveryField, v: T) -> Result<()>
pub fn set_recovery<T>(&mut self, field: RecoveryField, v: T) -> Result<()>
Set a recovery field.
Sourcepub fn get_inputs(&self) -> Result<Vec<PluginVal>>
pub fn get_inputs(&self) -> Result<Vec<PluginVal>>
Get the inputs.
Sourcepub fn get_bytes(&mut self, tag: u64, len: u64) -> Result<Vec<u8>>
pub fn get_bytes(&mut self, tag: u64, len: u64) -> Result<Vec<u8>>
Read some bytes and advances the related buffer (i.e., multiple calls give different results).
Sourcepub fn put_bytes(&mut self, tag: u64, b: &[u8]) -> Result<usize>
pub fn put_bytes(&mut self, tag: u64, b: &[u8]) -> Result<usize>
Write some bytes and advances the related buffer (i.e., multiple calls gives different results).
Sourcepub fn register(&mut self, r: Registration) -> Result<()>
pub fn register(&mut self, r: Registration) -> Result<()>
Perform a registration to the host implementation. This operation is usually performed during the initialization of the plugin.
Sourcepub fn set_timer(
&mut self,
ts: UnixInstant,
id: u64,
timer_id: u64,
) -> Result<()>
pub fn set_timer( &mut self, ts: UnixInstant, id: u64, timer_id: u64, ) -> Result<()>
Set a timer at the provided time to call the given callback function with the provided name.
Returns the identifier to the timer event, as provided as argument.
Sourcepub fn cancel_timer(&mut self, id: u64) -> Result<()>
pub fn cancel_timer(&mut self, id: u64) -> Result<()>
Cancel the timer event having the identifier provided.
Sourcepub fn get_unix_instant(&self) -> Result<UnixInstant>
pub fn get_unix_instant(&self) -> Result<UnixInstant>
Get the current UNIX instant.
Auto Trait Implementations§
impl Freeze for PluginEnv
impl RefUnwindSafe for PluginEnv
impl Send for PluginEnv
impl Sync for PluginEnv
impl Unpin for PluginEnv
impl UnwindSafe for PluginEnv
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.