Struct mbox::mbox::MBox [] [src]

pub struct MBox<T: ?Sized + Free>(_);

A malloc-backed box. This structure allows Rust to exchange objects with C without cloning.

Methods

impl<T: ?Sized + Free> MBox<T>
[src]

[src]

Constructs a new malloc-backed box from a pointer allocated by malloc. The content of the pointer must be already initialized.

[src]

Obtains the pointer owned by the box.

[src]

Obtains the mutable pointer owned by the box.

impl<T: ?Sized + Free> MBox<T>
[src]

[src]

Consumes the box and returns the original pointer.

The caller is responsible for freeing the pointer after this.

impl<T> MBox<T>
[src]

[src]

Constructs a new malloc-backed box, and move an initialized value into it.

impl<T> MBox<[T]>
[src]

[src]

Constructs a new malloc-backed slice from the pointer and the length (number of items).

The malloced size of the pointer must be at least len * size_of::<T>(). The content must already been initialized.

impl<T: Clone> MBox<[T]>
[src]

[src]

Creates a new malloc-boxed slice by cloning the content of an existing slice.

impl MBox<str>
[src]

[src]

Constructs a new malloc-backed string from the pointer and the length (number of UTF-8 code units).

The malloced size of the pointer must be at least len. The content must already been initialized and be valid UTF-8.

[src]

Constructs a new malloc-backed string from the pointer and the length (number of UTF-8 code units).

The malloced size of the pointer must be at least len. If the content does not contain valid UTF-8, this method returns an Err.

[src]

Converts the string into raw bytes.

[src]

Creates a string from raw bytes. The bytes must be valid UTF-8.

[src]

Creates a string from raw bytes. If the content does not contain valid UTF-8, this method returns an Err.

[src]

Creates a new malloc-boxed string by cloning the content of an existing string slice.

Trait Implementations

impl<T: ?Sized + Free> Drop for MBox<T>
[src]

[src]

Executes the destructor for this type. Read more

impl<T: ?Sized + Free> Deref for MBox<T>
[src]

The resulting type after dereferencing.

Important traits for &'a mut W
[src]

Dereferences the value.

impl<T: ?Sized + Free> StableDeref for MBox<T>
[src]

impl<T: ?Sized + Free> DerefMut for MBox<T>
[src]

Important traits for &'a mut W
[src]

Mutably dereferences the value.

impl<T: ?Sized + Free> AsRef<T> for MBox<T>
[src]

Important traits for &'a mut W
[src]

Performs the conversion.

impl<T: ?Sized + Free> AsMut<T> for MBox<T>
[src]

Important traits for &'a mut W
[src]

Performs the conversion.

impl<T: ?Sized + Free> Borrow<T> for MBox<T>
[src]

Important traits for &'a mut W
[src]

Immutably borrows from an owned value. Read more

impl<T: ?Sized + Free> BorrowMut<T> for MBox<T>
[src]

Important traits for &'a mut W
[src]

Mutably borrows from an owned value. Read more

impl<T: ?Sized + Free + Unsize<U>, U: ?Sized + Free> CoerceUnsized<MBox<U>> for MBox<T>
[src]

impl<T: ?Sized + Free> Pointer for MBox<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: ?Sized + Free + Debug> Debug for MBox<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: ?Sized + Free + Display> Display for MBox<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: ?Sized + Free + Hash> Hash for MBox<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<U: ?Sized + Free, T: ?Sized + Free + PartialEq<U>> PartialEq<MBox<U>> for MBox<T>
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<T: ?Sized + Free + Eq> Eq for MBox<T>
[src]

impl<U: ?Sized + Free, T: ?Sized + Free + PartialOrd<U>> PartialOrd<MBox<U>> for MBox<T>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: ?Sized + Free + Ord> Ord for MBox<T>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T> From<T> for MBox<T>
[src]

[src]

Performs the conversion.

impl<T: Clone> Clone for MBox<T>
[src]

[src]

Returns a copy of the value. Read more

[src]

Performs copy-assignment from source. Read more

impl<T: Default> Default for MBox<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T> Default for MBox<[T]>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T: Clone> Clone for MBox<[T]>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> FromIterator<T> for MBox<[T]>
[src]

[src]

Creates a value from an iterator. Read more

impl<T> IntoIterator for MBox<[T]>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for MSliceIntoIter<T>
[src]

Creates an iterator from a value. Read more

impl<'a, T> IntoIterator for &'a MBox<[T]>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for Iter<'a, T>
[src]

Creates an iterator from a value. Read more

impl<'a, T> IntoIterator for &'a mut MBox<[T]>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for IterMut<'a, T>
[src]

Creates an iterator from a value. Read more

impl Default for MBox<str>
[src]

[src]

Returns the "default value" for a type. Read more

impl Clone for MBox<str>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T: ?Sized> Send for MBox<T> where
    T: Send

impl<T: ?Sized> Sync for MBox<T> where
    T: Sync