pub trait PresetModel:
Debug
+ Send
+ Sync {
Show 13 methods
// Required methods
fn header(&self) -> Header;
fn get(&self, key: &str) -> Option<Stored>;
fn set(&mut self, key: &str, value: Stored) -> Result<(), FormatError>;
fn reset(&mut self, key: &str);
fn routes(&self) -> Vec<Option<Route>>;
fn set_route(
&mut self,
slot: usize,
route: Option<Route>,
) -> Result<(), FormatError>;
fn set_name(&mut self, name: &str) -> Result<(), FormatError>;
fn set_author(&mut self, author: &str) -> Result<(), FormatError>;
fn set_description(&mut self, description: &str) -> Result<(), FormatError>;
fn set_tags(&mut self, tags: &[String]) -> Result<(), FormatError>;
fn describe(&self, opts: &DescribeOptions) -> Description;
fn unknown_keys(&self) -> Vec<String>;
fn as_any(&self) -> &dyn Any;
}Expand description
A decoded preset.
Required Methods§
Sourcefn get(&self, key: &str) -> Option<Stored>
fn get(&self, key: &str) -> Option<Stored>
The value of a control as the file holds it, or None when the key
is absent. An explicit default is Some.
Sourcefn set(&mut self, key: &str, value: Stored) -> Result<(), FormatError>
fn set(&mut self, key: &str, value: Stored) -> Result<(), FormatError>
Sets a control.
§Errors
A FormatError when the format cannot hold the value there. The
model is unchanged then.
Sourcefn reset(&mut self, key: &str)
fn reset(&mut self, key: &str)
Removes a control, or writes its default where the format needs one.
Sourcefn set_route(
&mut self,
slot: usize,
route: Option<Route>,
) -> Result<(), FormatError>
fn set_route( &mut self, slot: usize, route: Option<Route>, ) -> Result<(), FormatError>
Sets or clears a modulation slot.
§Errors
A FormatError when the slot does not exist or the route does not
fit the format. The model is unchanged then.
Sourcefn set_description(&mut self, description: &str) -> Result<(), FormatError>
fn set_description(&mut self, description: &str) -> Result<(), FormatError>
Sourcefn describe(&self, opts: &DescribeOptions) -> Description
fn describe(&self, opts: &DescribeOptions) -> Description
The ordered tree that preset inspect prints.
Sourcefn unknown_keys(&self) -> Vec<String>
fn unknown_keys(&self) -> Vec<String>
Keys in the file that the registry does not cover, as paths such as
settings.custom_warps. They stay in the model and survive a write.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".