Skip to content

Commit 5a52c23

Browse files
Merge pull request #76 from Janonard/missing-state-features
Missing State features
2 parents 5d18c09 + c318b90 commit 5a52c23

File tree

4 files changed

+561
-3
lines changed

4 files changed

+561
-3
lines changed

state/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ lv2-atom = "1.0.0"
2020
urid = "0.1.0"
2121

2222
[dev-dependencies]
23-
lv2-urid = "2.0.0"
23+
lv2-urid = "2.0.0"
24+
mktemp = "0.4.0"

state/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
//!
33
//! This is a rather classic extension to LV2 plugins: There is a trait called [`State`](trait.State.html) which requires the methods [`save`](trait.State.html#tymethod.save) and [`restore`](trait.State.html#tymethiod.restore) to be implemented. These methods will be called by the host to save and restore the state of the plugin.
44
//!
5+
//! ## Refering to files
6+
//!
7+
//! This crate also includes features to create files in a unique namespace for the plugin instance. However, these files will not persist across `save`/`restore` calls and therefore need to be safed together with the state as well. For more information, see the documentation of the [`path` module](path/index.html).
8+
//!
59
//! ## Example usage
610
//!
711
//! ```
@@ -88,6 +92,8 @@ pub use raw::*;
8892
mod storage;
8993
pub use storage::Storage;
9094

95+
pub mod path;
96+
9197
/// Kinds of errors that may occur in the crate.
9298
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9399
pub enum StateErr {
@@ -107,6 +113,10 @@ pub enum StateErr {
107113
NoProperty,
108114
/// There isn't enough memory available to execute the task.
109115
NoSpace,
116+
/// A path that's been used as a parameter is not encoded in UTF-8.
117+
PathNotUTF8,
118+
/// The host does not comply to the specification.
119+
HostError,
110120
}
111121

112122
impl StateErr {

0 commit comments

Comments
 (0)