pub struct SettingsSchema { /* private fields */ }Expand description
An owned, recursively searchable snapshot of an OBS property tree.
Implementations§
Source§impl SettingsSchema
impl SettingsSchema
pub fn new(properties: Vec<PropertyMetadata>) -> Self
pub fn properties(&self) -> &[PropertyMetadata]
Sourcepub fn property(&self, name: &str) -> Option<&PropertyMetadata>
pub fn property(&self, name: &str) -> Option<&PropertyMetadata>
Finds a property by its OBS name, recursively descending through property groups.
Sourcepub fn validate(
&self,
name: &str,
value: &PropertyValue,
) -> Result<(), ObsError>
pub fn validate( &self, name: &str, value: &PropertyValue, ) -> Result<(), ObsError>
Validates a value against the runtime-discovered metadata without mutating OBS data.
Sourcepub fn set(
&self,
settings: &mut ObsData,
name: &str,
value: PropertyValue,
) -> Result<(), ObsError>
pub fn set( &self, settings: &mut ObsData, name: &str, value: PropertyValue, ) -> Result<(), ObsError>
Validates and applies one scalar property value to an ObsData object.
Sourcepub fn value(
&self,
settings: &ObsData,
name: &str,
) -> Result<Option<PropertyValue>, ObsError>
pub fn value( &self, settings: &ObsData, name: &str, ) -> Result<Option<PropertyValue>, ObsError>
Reads a scalar property using the value category declared by this schema.
Sourcepub fn snapshot(
&self,
current: &ObsData,
defaults: Option<&ImmutableObsData>,
) -> Result<SettingsSnapshot, ObsError>
pub fn snapshot( &self, current: &ObsData, defaults: Option<&ImmutableObsData>, ) -> Result<SettingsSnapshot, ObsError>
Joins this dynamic schema with current and default values into one form-ready snapshot.
Trait Implementations§
Source§impl Clone for SettingsSchema
impl Clone for SettingsSchema
Source§fn clone(&self) -> SettingsSchema
fn clone(&self) -> SettingsSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SettingsSchema
impl Debug for SettingsSchema
Source§impl Default for SettingsSchema
impl Default for SettingsSchema
Source§fn default() -> SettingsSchema
fn default() -> SettingsSchema
Returns the “default value” for a type. Read more
Source§impl PartialEq for SettingsSchema
impl PartialEq for SettingsSchema
impl StructuralPartialEq for SettingsSchema
Auto Trait Implementations§
impl Freeze for SettingsSchema
impl RefUnwindSafe for SettingsSchema
impl Send for SettingsSchema
impl Sync for SettingsSchema
impl Unpin for SettingsSchema
impl UnsafeUnpin for SettingsSchema
impl UnwindSafe for SettingsSchema
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