pub struct GeneratorOptions { /* private fields */ }Expand description
Generator options parsed from a Lua table.
Implementations§
Source§impl GeneratorOptions
impl GeneratorOptions
Sourcepub fn insert(&mut self, name: impl Into<String>, value: GeneratorOption)
pub fn insert(&mut self, name: impl Into<String>, value: GeneratorOption)
Inserts or replaces one named option.
Sourcepub fn required_usize(&self, name: &str) -> PulseResult<usize>
pub fn required_usize(&self, name: &str) -> PulseResult<usize>
Reads a required positive usize option.
§Errors
Returns an error when the option is missing, non-integer, zero, or too large.
Sourcepub fn usize_or(&self, name: &str, default: usize) -> PulseResult<usize>
pub fn usize_or(&self, name: &str, default: usize) -> PulseResult<usize>
Reads an optional positive usize option.
§Errors
Returns an error when the supplied option is non-integer, zero, or too large.
Sourcepub fn required_u32(&self, name: &str) -> PulseResult<u32>
pub fn required_u32(&self, name: &str) -> PulseResult<u32>
Reads a required non-negative u32 option.
§Errors
Returns an error when the option is missing, negative, non-integer, or too large.
Sourcepub fn u32_or(&self, name: &str, default: u32) -> PulseResult<u32>
pub fn u32_or(&self, name: &str, default: u32) -> PulseResult<u32>
Reads an optional non-negative u32 option.
§Errors
Returns an error when the supplied option is negative, non-integer, or too large.
Sourcepub fn f32_or(&self, name: &str, default: f32) -> PulseResult<f32>
pub fn f32_or(&self, name: &str, default: f32) -> PulseResult<f32>
Reads an optional finite f32 option.
§Errors
Returns an error when the supplied option is not numeric or not finite.
Sourcepub fn required_f32(&self, name: &str) -> PulseResult<f32>
pub fn required_f32(&self, name: &str) -> PulseResult<f32>
Reads a required finite f32 option.
§Errors
Returns an error when the option is missing, not numeric, or not finite.
Sourcepub fn required_text(&self, name: &str) -> PulseResult<&str>
pub fn required_text(&self, name: &str) -> PulseResult<&str>
Sourcepub fn required_text_map(
&self,
name: &str,
) -> PulseResult<&BTreeMap<String, String>>
pub fn required_text_map( &self, name: &str, ) -> PulseResult<&BTreeMap<String, String>>
Reads a required string-to-string map option.
§Errors
Returns an error when the option is missing or not a text map.
Trait Implementations§
Source§impl Clone for GeneratorOptions
impl Clone for GeneratorOptions
Source§fn clone(&self) -> GeneratorOptions
fn clone(&self) -> GeneratorOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GeneratorOptions
impl Debug for GeneratorOptions
Source§impl Default for GeneratorOptions
impl Default for GeneratorOptions
Source§fn default() -> GeneratorOptions
fn default() -> GeneratorOptions
Source§impl PartialEq for GeneratorOptions
impl PartialEq for GeneratorOptions
Source§fn eq(&self, other: &GeneratorOptions) -> bool
fn eq(&self, other: &GeneratorOptions) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GeneratorOptions
Auto Trait Implementations§
impl Freeze for GeneratorOptions
impl RefUnwindSafe for GeneratorOptions
impl Send for GeneratorOptions
impl Sync for GeneratorOptions
impl Unpin for GeneratorOptions
impl UnsafeUnpin for GeneratorOptions
impl UnwindSafe for GeneratorOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
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>
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