pub struct CompositorResourceHolder { /* private fields */ }Expand description
Holds the server-side counterparts of a media object, one per compositor the object is used with.
Implementations§
Source§impl CompositorResourceHolder
impl CompositorResourceHolder
pub fn new() -> Self
Sourcepub fn is_attached(&self) -> bool
pub fn is_attached(&self) -> bool
Whether the object is attached to any compositor.
Sourcepub fn create_or_add_ref(
&self,
compositor: &Rc<Compositor>,
owner: Option<Rc<dyn ICompositorSerializable>>,
factory: impl FnOnce(&Rc<Compositor>) -> ServerObjectId,
) -> (ServerObjectId, bool)
pub fn create_or_add_ref( &self, compositor: &Rc<Compositor>, owner: Option<Rc<dyn ICompositorSerializable>>, factory: impl FnOnce(&Rc<Compositor>) -> ServerObjectId, ) -> (ServerObjectId, bool)
Adds a reference to the counterpart on compositor, creating it
with factory if there is none. Returns the counterpart and whether
it was created; a newly created counterpart’s owner is registered
for serialization.
pub fn try_get_for_compositor( &self, compositor: &Compositor, ) -> Option<ServerObjectId>
pub fn get_for_compositor(&self, compositor: &Compositor) -> ServerObjectId
Sourcepub fn release(&self, compositor: &Compositor) -> bool
pub fn release(&self, compositor: &Compositor) -> bool
Drops one reference to the counterpart on compositor. Returns
whether it was the last one.
Sourcepub fn process_property_change_notification(
&self,
old_value: Option<&dyn ICompositionRenderResource>,
new_value: Option<&dyn ICompositionRenderResource>,
)
pub fn process_property_change_notification( &self, old_value: Option<&dyn ICompositionRenderResource>, new_value: Option<&dyn ICompositionRenderResource>, )
Moves the references this object holds on a property value from the old value to the new one, on every compositor.
pub fn transitive_release_all( &self, old_resource: &dyn ICompositionRenderResource, )
pub fn transitive_add_ref_all( &self, new_resource: &dyn ICompositionRenderResource, )
pub fn register_for_invalidation_on_all_compositors( &self, serializable: &Rc<dyn ICompositorSerializable>, )
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CompositorResourceHolder
impl !RefUnwindSafe for CompositorResourceHolder
impl !Send for CompositorResourceHolder
impl !Sync for CompositorResourceHolder
impl !UnwindSafe for CompositorResourceHolder
impl Unpin for CompositorResourceHolder
impl UnsafeUnpin for CompositorResourceHolder
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more