Struct mpi::datatype::DynBufferMut
[−]
[src]
pub struct DynBufferMut<'a> { /* fields omitted */ }
A mutable 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 &mut Any
. It is semantically equivalent to the
mutable trait object reference &mut BufferMut
.
Methods
impl<'a> DynBufferMut<'a>
[src]
pub fn new<T: Equivalence>(buf: &'a mut [T]) -> Self
[src]
Creates a mutable buffer from a mutable 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 mut [T]>
[src]
Returns some mutable slice if the type matches T
, or None
if it doesn't.
pub unsafe fn from_raw<T>(
ptr: *mut T,
len: Count,
datatype: DatatypeRef<'a>
) -> Self
[src]
ptr: *mut 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.
pub fn as_mut_ptr(&mut self) -> *mut c_void
[src]
Returns the underlying raw pointer.
pub fn reborrow(&self) -> DynBuffer
[src]
Reborrows the buffer with a shorter lifetime.
pub fn reborrow_mut(&mut self) -> DynBufferMut
[src]
Reborrows the buffer mutably with a shorter lifetime.
pub fn downgrade(self) -> DynBuffer<'a>
[src]
Makes the buffer immutable.
Trait Implementations
impl<'a> Debug for DynBufferMut<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> Send for DynBufferMut<'a>
[src]
impl<'a> Sync for DynBufferMut<'a>
[src]
impl<'a> Collection for DynBufferMut<'a>
[src]
impl<'a> Pointer for DynBufferMut<'a>
[src]
impl<'a> PointerMut for DynBufferMut<'a>
[src]
unsafe fn pointer_mut(&mut self) -> *mut c_void
[src]
A mutable pointer to the starting address in memory
impl<'a> Buffer for DynBufferMut<'a>
[src]
impl<'a> BufferMut for DynBufferMut<'a>
[src]
impl<'a> AsDatatype for DynBufferMut<'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