ObsObjectTrait

Trait ObsObjectTrait 

Source
pub trait ObsObjectTrait<K: Clone>: ObsObjectClone<K> + ObsObjectTraitPrivate {
    // Required methods
    fn runtime(&self) -> &ObsRuntime;
    fn settings(&self) -> Result<ImmutableObsData, ObsError>;
    fn hotkey_data(&self) -> Result<ImmutableObsData, ObsError>;
    fn id(&self) -> ObsString;
    fn name(&self) -> ObsString;
    fn update_settings(&self, settings: ObsData) -> Result<(), ObsError>;
    fn as_ptr(&self) -> SmartPointerSendable<K>;

    // Provided method
    fn create_updater<'a, T: ObsObjectUpdater<'a, K, ToUpdate = Self> + Send + Sync>(
        &'a mut self,
    ) -> Result<T, ObsError>
       where Self: Sized + Send + Sync { ... }
}
Expand description

Trait representing an OBS object. A OBs object has an id, a name, settings and hotkey_data.

Required Methods§

Source

fn runtime(&self) -> &ObsRuntime

Source

fn settings(&self) -> Result<ImmutableObsData, ObsError>

Source

fn hotkey_data(&self) -> Result<ImmutableObsData, ObsError>

Source

fn id(&self) -> ObsString

Source

fn name(&self) -> ObsString

Source

fn update_settings(&self, settings: ObsData) -> Result<(), ObsError>

Updates the settings of this output. Fails if active.

Source

fn as_ptr(&self) -> SmartPointerSendable<K>

Creates a new reference to the drop guard. This is useful if you are using the underlying raw pointer, make sure to store it along the drop guard

Provided Methods§

Source

fn create_updater<'a, T: ObsObjectUpdater<'a, K, ToUpdate = Self> + Send + Sync>( &'a mut self, ) -> Result<T, ObsError>
where Self: Sized + Send + Sync,

Updates the object with the current settings. For examples please take a look at the Github repository.

Trait Implementations§

Source§

impl<K: Clone> Clone for Box<dyn ObsObjectTrait<K>>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§