Struct glib::send_unique::SendUniqueCell [−][src]
pub struct SendUniqueCell<T: SendUnique> { /* fields omitted */ }
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]
impl<T: SendUnique> SendUniqueCell<T>
pub fn new(obj: T) -> Result<Self, T>
[src]
pub fn new(obj: T) -> Result<Self, T>
Create a new SendUniqueCell
out of obj
Fails if obj
is not unique at this time
pub fn borrow(&self) -> Ref<T>
[src]
pub fn borrow(&self) -> Ref<T>
Borrow the contained object or panic if borrowing is not possible at this time
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError>
[src]
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError>
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]
pub fn into_inner(self) -> T
Extract the contained object or panic if it is not possible at this time
pub fn try_into_inner(self) -> Result<T, Self>
[src]
pub fn try_into_inner(self) -> Result<T, Self>
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: Debug + SendUnique> Debug for SendUniqueCell<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: SendUnique> Send for SendUniqueCell<T>
[src]
impl<T: SendUnique> Send for SendUniqueCell<T>
Auto Trait Implementations
impl<T> !Sync for SendUniqueCell<T>
impl<T> !Sync for SendUniqueCell<T>