[−][src]Struct glib::send_unique::SendUniqueCell
Allows sending reference counted objects that don't implement Send
to other threads
as long as only a single reference to the object exists.
Methods
impl<T: SendUnique> SendUniqueCell<T>
[src]
pub fn new(obj: T) -> Result<Self, T>
[src]
Create a new SendUniqueCell
out of obj
Fails if obj
is not unique at this time
pub fn borrow(&self) -> Ref<T>
[src]
Borrow the contained object or panic if borrowing is not possible at this time
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError>
[src]
Try borrowing the contained object
Borrowing is possible as long as only a single reference to the object exists, or it is borrowed from the same thread currently
pub fn into_inner(self) -> T
[src]
Extract the contained object or panic if it is not possible at this time
pub fn try_into_inner(self) -> Result<T, Self>
[src]
Try extracing the contained object
Borrowing is possible as long as only a single reference to the object exists, or it is borrowed from the same thread currently
Trait Implementations
impl<T: Debug + SendUnique> Debug for SendUniqueCell<T>
[src]
impl<T: SendUnique> Send for SendUniqueCell<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for SendUniqueCell<T>
impl<T> !Sync for SendUniqueCell<T>
impl<T> Unpin for SendUniqueCell<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SendUniqueCell<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,