Struct llvm::CSemiBox
[−]
[src]
pub struct CSemiBox<'a, D> where D: DisposeRef + 'a + ?Sized {
// some 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> CSemiBox<'a, D> where D: DisposeRef + 'a + ?Sized
fn new(ptr: *mut D::RefTo) -> CSemiBox<'a, D>
Wrap the pointer in a CSemiBox
unsafe fn as_ptr(&self) -> *mut D::RefTo
Returns the internal pointer
unsafe fn unwrap(self) -> *mut D::RefTo
Returns the internal pointer
Trait Implementations
impl<'a, D> From<*mut D::RefTo> for CSemiBox<'a, D> where D: DisposeRef + 'a + ?Sized
impl<'a, D> Drop for CSemiBox<'a, D> where D: DisposeRef + 'a + ?Sized
fn drop(&mut self)
Run the destructor
impl<'a, D> Deref for CSemiBox<'a, D> where D: DisposeRef + 'a, *mut D::RefTo: Into<&'a D>
type Target = D
The resulting type after dereferencing
fn deref(&self) -> &D
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>
fn borrow(&self) -> &D
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>
fn deref_mut(&mut self) -> &mut D
impl<'a, T> Display for CSemiBox<'a, T> where T: Display + DisposeRef + 'a, *mut T::RefTo: Into<&'a T>
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<'a, T> Debug for CSemiBox<'a, T> where T: Debug + DisposeRef + 'a, *mut T::RefTo: Into<&'a T>
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<'a, T> PartialEq<T> for CSemiBox<'a, T> where T: 'a + DisposeRef + PartialEq<T>, *mut T::RefTo: Into<&'a T>
fn eq(&self, other: &T) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.