Crate foreign

Source

Modules§

prelude

Structs§

BorrowedMutPointer
A pointer whose contents were borrowed from a Rust object, and therefore whose lifetime is limited to the lifetime of the underlying Rust object. The Rust object is borrowed from an exclusive reference, and therefore the pointer is mutable.
BorrowedPointer
A pointer whose contents were borrowed from a Rust object, and therefore whose lifetime is limited to the lifetime of the underlying Rust object. The Rust object was borrowed from a shared reference, and therefore the pointer is not mutable.
OwnedPointer
A RAII pointer that is automatically freed when it goes out of scope.

Traits§

BorrowForeign
A type for which a C representation can be borrowed without cloning.
BorrowForeignMut
A type for which a C representation can be borrowed mutably without cloning.
CloneToForeign
A type for which a representation as a C datum can be produced.
FixedAlloc
A type which is stored in a fixed amount of memory given by mem::size_of::<Self::Foreign>().
FreeForeign
A type for which there is a canonical representation as a C datum.
FromForeign
A type which can be constructed from a canonical representation as a C datum.
IntoForeign
A type for which a C representation can be created by consuming the Rust representation, hopefully without cloning much of the internal data.
IntoNative
Convert a C datum into a native Rust object, taking ownership of the C datum. You should not need to implement this trait as long as Rust types implement FromForeign.