pub struct VitalFormat { /* private fields */ }Expand description
The .vital format.
A read parses the whole JSON tree. Peak memory depends on the shape of
the file: a file of long base64 texts takes about 3 times its size, and
a file of short numbers up to about 38 times. Measured in a release
build: 60 MB of 0, items peaked at 2.28 GB, 60 MB in one text at
184 MB.
Implementations§
Trait Implementations§
Source§impl Debug for VitalFormat
impl Debug for VitalFormat
Source§impl PresetFormat for VitalFormat
impl PresetFormat for VitalFormat
Source§fn max_bytes(&self) -> usize
fn max_bytes(&self) -> usize
The largest input
PresetFormat::read accepts, in bytes.Source§fn read(&self, bytes: &[u8]) -> Result<Box<dyn PresetModel>, FormatError>
fn read(&self, bytes: &[u8]) -> Result<Box<dyn PresetModel>, FormatError>
Decodes a preset. Read more
Source§fn read_header(&self, bytes: &[u8]) -> Result<Header, FormatError>
fn read_header(&self, bytes: &[u8]) -> Result<Header, FormatError>
Decodes only the header fields, without the large parts. Read more
Source§fn write(&self, model: &dyn PresetModel) -> Result<Vec<u8>, FormatError>
fn write(&self, model: &dyn PresetModel) -> Result<Vec<u8>, FormatError>
Encodes a model of this synth. Read more
Source§fn absent_means_default(&self, _key: &str) -> bool
fn absent_means_default(&self, _key: &str) -> bool
Whether a missing key and an explicit default sound the same.
Source§fn template(&self) -> &dyn TemplateSource
fn template(&self) -> &dyn TemplateSource
Where the template of this synth comes from.
Source§fn route_sources(&self) -> &'static [&'static str]
fn route_sources(&self) -> &'static [&'static str]
The names a modulation source may take.
Source§fn default_polarity(&self, source: &str) -> RoutePolarity
fn default_polarity(&self, source: &str) -> RoutePolarity
The polarity of a route whose edit names none.
Source§fn check_value(&self, _key: &str, _stored: f64) -> Result<(), FormatError>
fn check_value(&self, _key: &str, _stored: f64) -> Result<(), FormatError>
Checks a stored value that the registry range allows but the writer
cannot write yet. Read more
Source§fn scan(
&self,
model: &dyn PresetModel,
edited: &[&str],
) -> Result<Vec<String>, FormatError>
fn scan( &self, model: &dyn PresetModel, edited: &[&str], ) -> Result<Vec<String>, FormatError>
Scans a model after an edit list: every control holds a value of the
right wire type inside its range, and the structured parts are
whole. Returns warnings, such as a route into a switched-off module. Read more
Source§fn factory_folder(&self) -> &'static [&'static str]
fn factory_folder(&self) -> &'static [&'static str]
The trailing folder names of the synth’s factory preset folder,
outermost first, such as the data folder and then
Factory. The
writer refuses to write into it. Empty when the synth has none.Auto Trait Implementations§
impl Freeze for VitalFormat
impl RefUnwindSafe for VitalFormat
impl Send for VitalFormat
impl Sync for VitalFormat
impl Unpin for VitalFormat
impl UnsafeUnpin for VitalFormat
impl UnwindSafe for VitalFormat
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more