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§impl Debug for SettingsSchema
impl Debug for SettingsSchema
Source§impl Default for SettingsSchema
impl Default for SettingsSchema
Source§impl PartialEq for SettingsSchema
impl PartialEq for SettingsSchema
impl StructuralPartialEq for SettingsSchema
Auto Trait Implementations§
impl Forget for SettingsSchema
impl Freeze for SettingsSchema
impl Move for SettingsSchema
impl RefUnwindSafe for SettingsSchema
impl Send for SettingsSchemawhere
RawVecInner: Send,
impl Sync for SettingsSchemawhere
RawVecInner: Sync,
impl Unpin for SettingsSchema
impl UnsafeUnpin for SettingsSchema
impl UnwindSafe for SettingsSchemawhere
RawVecInner: UnwindSafe,
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