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<Local<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( _deserializer: D ) -> Result<Local<T>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> PartialEq<Local<T>> for Local<T>where
T: PartialEq<T>,
impl<T> PartialEq<Local<T>> for Local<T>where T: PartialEq<T>,
source§impl<T> Serialize for Local<T>
impl<T> Serialize for Local<T>
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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
impl<T> Copy for Local<T>where T: Copy,
impl<T> Eq for Local<T>where T: Eq,
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§
§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§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.