Struct elfo::MoveOwnership [−][src]
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
pub fn deserialize<D>(
_deserializer: D
) -> Result<MoveOwnership<T>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
_deserializer: D
) -> Result<MoveOwnership<T>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for MoveOwnership<T>
impl<T> Send for MoveOwnership<T> where
T: Send,
impl<T> Sync for MoveOwnership<T> where
T: Send,
impl<T> Unpin for MoveOwnership<T>
impl<T> !UnwindSafe for MoveOwnership<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more