Skip to main content

ObsObjectTrait

Trait ObsObjectTrait 

Source
pub trait ObsObjectTrait: 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>;

    // Provided methods
    fn create_updater<'a, T: ObsObjectUpdater<'a, ToUpdate = Self> + Send + Sync>(
        &'a mut self,
    ) -> Result<T, ObsError>
       where Self: Sized + Send + Sync { ... }
    fn object_id(&self) -> NativeObjectId { ... }
}
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.

Provided Methods§

Source

fn create_updater<'a, T: ObsObjectUpdater<'a, 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.

Source

fn object_id(&self) -> NativeObjectId

Stable opaque identity for this native object. It is scoped to the owning runtime.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§