Struct elfo_core::MoveOwnership
source · pub struct MoveOwnership<T>(_);
Expand description
Used to transfer ownership over messaging.
Messages must be instances of Clone
, Serialize
and Deserialize
because
of network communication and message dumping. However, in some cases, it’s
desired to have messages that cannot satisfy requirements.
For instance, when sending sockets or files.
MoveOwnership<T>
implements Debug
, Clone
, Serialize
and
Deserialize
for any T
. Meanwhile, it can be serialized (but w/o useful
information), it cannot be deserialized (it returns an error on attempts).
Example
ⓘ
#[message]
pub struct HandleFile {
pub path: PathBuf,
pub file: MoveOwnership<File>,
}
Implementations§
Trait Implementations§
source§impl<T> Clone for MoveOwnership<T>
impl<T> Clone for MoveOwnership<T>
source§fn clone(&self) -> MoveOwnership<T>
fn clone(&self) -> MoveOwnership<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for MoveOwnership<T>
impl<T> Debug for MoveOwnership<T>
source§impl<'de, T> Deserialize<'de> for MoveOwnership<T>
impl<'de, T> Deserialize<'de> for MoveOwnership<T>
source§fn deserialize<D>(_deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(_deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more