[−][src]Struct lv2_state::StoreHandle
Property storage handle.
This handle can be used to store the properties of a plugin. It uses the atom system to encode the properties and is backed by a storage callback function.
The written properties a buffered and flushed when requested. Create new properties by calling draft
and write them like any other atom. Once you are done, you can commit your properties by calling commit_all
or commit
. You have to commit manually: Uncommitted properties will be discarded when the handle is dropped.
Methods
impl<'a> StoreHandle<'a>
[src]
pub fn new(store_fn: LV2_State_Store_Function, handle: LV2_State_Handle) -> Self
[src]
Create a new store handle.
pub fn draft(&mut self, property_key: URID) -> StatePropertyWriter
[src]
Draft a new property.
This will return a new handle to create a property. Once the property is completely written, you can commit it by calling commit
or commit_all
. Then, and only then, it will be saved by the host.
If you began to write a property and don't want the written things to be stored, you can discard it with discard
or discard_all
.
pub fn commit_pair(
store_fn: LV2_State_Store_Function,
handle: LV2_State_Handle,
key: URID,
space: SpaceElement
) -> Result<(), StateErr>
[src]
store_fn: LV2_State_Store_Function,
handle: LV2_State_Handle,
key: URID,
space: SpaceElement
) -> Result<(), StateErr>
Internal helper function to store a property.
pub fn commit_all(&mut self) -> Result<(), StateErr>
[src]
Commit all created properties.
This will also clear the property buffer.
pub fn commit(&mut self, key: URID) -> Option<Result<(), StateErr>>
[src]
Commit one specific property.
This method returns None
if the requested property was not marked for commit, Some(Ok(()))
if the property was stored and Some(Err(_))
if an error occured while storing the property.
pub fn discard_all(&mut self)
[src]
Discard all drafted properties.
pub fn discard(&mut self, key: URID)
[src]
Discard a drafted property.
If no property with the given key was drafted before, this is a no-op.
Auto Trait Implementations
impl<'a> RefUnwindSafe for StoreHandle<'a>
impl<'a> !Send for StoreHandle<'a>
impl<'a> !Sync for StoreHandle<'a>
impl<'a> Unpin for StoreHandle<'a>
impl<'a> !UnwindSafe for StoreHandle<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,