pub struct AttributeKey(/* private fields */);
Expand description
Attribute keys are used internally to access attributes. They are obtained
with the associated function CommAttribute::get_key()
.
User keys are created with MPI_Comm_create_keyval()
and should be freed
with MPI_Comm_free_keyval()
. They are provisioned in the default
implementation of CommAttribute::get_key()
and stored persistently in
COMM_ATTRS
.
System keys are automatically available and are not passed to
MPI_Comm_free_keyval()
.
Implementations§
Source§impl AttributeKey
impl AttributeKey
Sourcepub unsafe fn new_unchecked(k: i32) -> Self
pub unsafe fn new_unchecked(k: i32) -> Self
Create a new attribute key. This is mostly unnecessary for users, but
may be used when implementing CommAttribute::get_key()
to be used with
a foreign keyval.
§Safety
The key must be a valid predefined system keyval or obtained by
MPI_Comm_create_keyval()
. Strictly speaking, I think this can be safe,
but an invalid value will cause MPI_Comm_get_attr()
and
MPI_Comm_set_attr()
to fail. Note that they can also be made to fail
if MPI_Comm_free_keyval()
is called after creating an AttributeKey
and before it is used. I’m leaving it unsafe
to be defensive and
because the caller should think carefully about lifetime of their
foreign keyvals when interoperating with Rust.
Trait Implementations§
Source§impl AsRaw for AttributeKey
impl AsRaw for AttributeKey
Source§impl Clone for AttributeKey
impl Clone for AttributeKey
Source§fn clone(&self) -> AttributeKey
fn clone(&self) -> AttributeKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more