Struct cbox::CSemiBox [] [src]

pub struct CSemiBox<'a, D: ?Sized> where
    D: DisposeRef + 'a, 
{ /* fields omitted */ }

A wrapper for pointers made by C that are now partially owned in Rust.

This is necessary to allow owned and borrowed representations of C types to be represented by the same type as they are in C with little overhead

Methods

impl<'a, D: ?Sized> CSemiBox<'a, D> where
    D: DisposeRef + 'a, 
[src]

Wrap the pointer in a CSemiBox

Returns the internal pointer

Returns the internal pointer

Trait Implementations

impl<'a, D: ?Sized> From<*mut D::RefTo> for CSemiBox<'a, D> where
    D: DisposeRef + 'a, 
[src]

Performs the conversion.

impl<'a, D: ?Sized> Drop for CSemiBox<'a, D> where
    D: DisposeRef + 'a, 
[src]

Run the destructor

impl<'a, D> Deref for CSemiBox<'a, D> where
    D: DisposeRef + 'a,
    *mut D::RefTo: Into<&'a D>, 
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a, D> Borrow<D> for CSemiBox<'a, D> where
    D: DisposeRef + 'a,
    *mut D::RefTo: Into<&'a D>, 
[src]

Immutably borrows from an owned value. Read more

impl<'a, D> DerefMut for CSemiBox<'a, D> where
    D: DisposeRef + 'a,
    *mut D::RefTo: Into<&'a D>,
    *mut D::RefTo: Into<&'a mut D>, 
[src]

The method called to mutably dereference a value

impl<'a, T> Display for CSemiBox<'a, T> where
    T: Display + DisposeRef + 'a,
    *mut T::RefTo: Into<&'a T>, 
[src]

Formats the value using the given formatter. Read more

impl<'a, T> Debug for CSemiBox<'a, T> where
    T: Debug + DisposeRef + 'a,
    *mut T::RefTo: Into<&'a T>, 
[src]

Formats the value using the given formatter.

impl<'a, T> PartialEq<T> for CSemiBox<'a, T> where
    T: 'a + DisposeRef + PartialEq,
    *mut T::RefTo: Into<&'a T>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> From<&'a CStr> for CSemiBox<'a, str>
[src]

Performs the conversion.