pub struct ContextBox<'l> { /* private fields */ }
Implementations§
Source§impl<'l> ContextBox<'l>
impl<'l> ContextBox<'l>
pub fn new( loop_: &'l Loop, properties: Option<PropertiesBox>, ) -> Result<ContextBox<'l>, Error>
Sourcepub unsafe fn from_raw(raw: NonNull<pw_context>) -> ContextBox<'l>
pub unsafe fn from_raw(raw: NonNull<pw_context>) -> ContextBox<'l>
Create a ContextBox
by taking ownership of a raw pw_context
.
§Safety
The provided pointer must point to a valid, well aligned pw_context
.
The raw context must not be manually destroyed or moved, as the new ContextBox
takes
ownership of it.
The lifetime of the returned box is unbounded. The caller is responsible to make sure that the loop used with this context outlives the context.
pub fn into_raw(self) -> NonNull<pw_context>
Methods from Deref<Target = Context>§
pub fn as_raw(&self) -> &pw_context
pub fn as_raw_ptr(&self) -> *mut pw_context
pub fn properties(&self) -> &Properties
pub fn update_properties(&self, properties: &DictRef)
pub fn connect( &self, properties: Option<PropertiesBox>, ) -> Result<CoreBox<'_>, Error>
pub fn connect_fd( &self, fd: OwnedFd, properties: Option<PropertiesBox>, ) -> Result<CoreBox<'_>, Error>
Trait Implementations§
Source§impl<'l> AsRef<Context> for ContextBox<'l>
impl<'l> AsRef<Context> for ContextBox<'l>
Source§impl<'l> Debug for ContextBox<'l>
impl<'l> Debug for ContextBox<'l>
Source§impl<'l> Deref for ContextBox<'l>
impl<'l> Deref for ContextBox<'l>
Auto Trait Implementations§
impl<'l> Freeze for ContextBox<'l>
impl<'l> RefUnwindSafe for ContextBox<'l>
impl<'l> !Send for ContextBox<'l>
impl<'l> !Sync for ContextBox<'l>
impl<'l> Unpin for ContextBox<'l>
impl<'l> UnwindSafe for ContextBox<'l>
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