Struct mpi::datatype::DynBuffer
[−]
[src]
pub struct DynBuffer<'a> { /* fields omitted */ }
An immutable dynamically-typed buffer.
The buffer has a definite length and MPI datatype, but it is not yet known which Rust type it
corresponds to. This is the MPI analogue of &Any
. It is semantically equivalent to the trait
object reference &Buffer
.
Methods
impl<'a> DynBuffer<'a>
[src]
pub fn new<T: Equivalence>(buf: &'a [T]) -> Self
[src]
Creates a buffer from a slice with whose type has an MPI equivalent.
pub fn is<T: Equivalence>(&self) -> bool
[src]
Tests whether the buffer type matches T
.
pub fn downcast<T: Equivalence>(self) -> Option<&'a [T]>
[src]
Returns some slice if the type matches T
, or None
if it doesn't.
pub unsafe fn from_raw<T>(
ptr: *const T,
len: Count,
datatype: DatatypeRef<'a>
) -> Self
[src]
ptr: *const T,
len: Count,
datatype: DatatypeRef<'a>
) -> Self
Creates a buffer from its raw components. The buffer must remain valid for 'a
and the
pointer must not be null.
pub fn len(&self) -> usize
[src]
Returns the number of elements in the buffer.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the buffer is empty
pub fn as_ptr(&self) -> *const c_void
[src]
Returns the underlying raw pointer.
Trait Implementations
impl<'a> Copy for DynBuffer<'a>
[src]
impl<'a> Clone for DynBuffer<'a>
[src]
fn clone(&self) -> DynBuffer<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for DynBuffer<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> Send for DynBuffer<'a>
[src]
impl<'a> Sync for DynBuffer<'a>
[src]
impl<'a> Collection for DynBuffer<'a>
[src]
impl<'a> Pointer for DynBuffer<'a>
[src]
impl<'a> AsDatatype for DynBuffer<'a>
[src]
type Out = DatatypeRef<'a>
The type of the associated MPI datatype (e.g. SystemDatatype
or UserDatatype
)
fn as_datatype(&self) -> Self::Out
[src]
The associated MPI datatype