pub struct Local<T>(_);
Expand description
Used to send values that cannot be serialized. Works inside the current node only.
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 channels.
Local<T>
implements Debug
, 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 OpenDirectChannel {
pub tx: Local<mpsc::Sender>,
}
Implementations§
source§impl<T> Local<T>
impl<T> Local<T>
pub fn into_inner(self) -> T
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Local<T>
impl<'de, T> Deserialize<'de> for Local<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
source§impl<T: PartialEq> PartialEq<Local<T>> for Local<T>
impl<T: PartialEq> PartialEq<Local<T>> for Local<T>
impl<T: Copy> Copy for Local<T>
impl<T: Eq> Eq for Local<T>
impl<T> StructuralEq for Local<T>
impl<T> StructuralPartialEq for Local<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Local<T>where T: RefUnwindSafe,
impl<T> Send for Local<T>where T: Send,
impl<T> Sync for Local<T>where T: Sync,
impl<T> Unpin for Local<T>where T: Unpin,
impl<T> UnwindSafe for Local<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T, A> DynAccess<T> for Awhere A: Access<T>, <A as Access<T>>::Guard: 'static,
source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load
.