pub struct Lv2StatePatch { /* private fields */ }Expand description
A portable snapshot of one LV2 plugin’s state, keyed by its URI.
Pairs a plugin URI with a PluginState and round-trips through the shared
Expr graph via Lv2StatePatch::to_expr and
Lv2StatePatch::from_expr.
Implementations§
Source§impl Lv2StatePatch
impl Lv2StatePatch
Sourcepub fn new(plugin_uri: impl Into<String>, state: PluginState) -> Result<Self>
pub fn new(plugin_uri: impl Into<String>, state: PluginState) -> Result<Self>
Builds a state patch for plugin_uri carrying state.
§Errors
Returns Error::Eval when plugin_uri is blank.
Sourcepub fn plugin_uri(&self) -> &str
pub fn plugin_uri(&self) -> &str
Returns the plugin URI this patch applies to.
Sourcepub fn state(&self) -> &PluginState
pub fn state(&self) -> &PluginState
Returns the captured plugin state.
Sourcepub fn to_expr(&self) -> Expr
pub fn to_expr(&self) -> Expr
Encodes this patch as a tagged Expr::Map in the plugin-lv2 namespace.
Sourcepub fn from_expr(expr: &Expr) -> Result<Self>
pub fn from_expr(expr: &Expr) -> Result<Self>
Decodes a patch from an Expr emitted by Lv2StatePatch::to_expr.
§Errors
Returns Error::Eval when expr is not a map, its tag is missing or
wrong, or the uri/state fields are absent or ill-typed.
Trait Implementations§
Source§impl Clone for Lv2StatePatch
impl Clone for Lv2StatePatch
Source§fn clone(&self) -> Lv2StatePatch
fn clone(&self) -> Lv2StatePatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Lv2StatePatch
impl Debug for Lv2StatePatch
Source§impl PartialEq for Lv2StatePatch
impl PartialEq for Lv2StatePatch
Source§fn eq(&self, other: &Lv2StatePatch) -> bool
fn eq(&self, other: &Lv2StatePatch) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Lv2StatePatch
Auto Trait Implementations§
impl Freeze for Lv2StatePatch
impl RefUnwindSafe for Lv2StatePatch
impl Send for Lv2StatePatch
impl Sync for Lv2StatePatch
impl Unpin for Lv2StatePatch
impl UnsafeUnpin for Lv2StatePatch
impl UnwindSafe for Lv2StatePatch
Blanket Implementations§
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