Struct elfo::Local[][src]

pub struct Local<T>(_);
Expand description

Messages must be instances of Serialize and Deserialize because of network communication and message dumping. However, in some cases, it’s desired to have messages that cannot be serialized. For instance, when sharding TCP sockets.

Local<T> implements 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).

Implementations

impl<T> Local<T>[src]

pub fn into_inner(self) -> T[src]

Trait Implementations

impl<T> Clone for Local<T> where
    T: Clone
[src]

pub fn clone(&self) -> Local<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T> Debug for Local<T>[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl<T> Default for Local<T> where
    T: Default
[src]

pub fn default() -> Local<T>[src]

Returns the “default value” for a type. Read more

impl<T> Deref for Local<T>[src]

type Target = T

The resulting type after dereferencing.

pub fn deref(&self) -> &<Local<T> as Deref>::Target[src]

Dereferences the value.

impl<'de, T> Deserialize<'de> for Local<T>[src]

pub fn deserialize<D>(
    _deserializer: D
) -> Result<Local<T>, <D as Deserializer<'de>>::Error> where
    D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<T> From<T> for Local<T>[src]

pub fn from(original: T) -> Local<T>[src]

Performs the conversion.

impl<T> PartialEq<Local<T>> for Local<T> where
    T: PartialEq<T>, 
[src]

pub fn eq(&self, other: &Local<T>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &Local<T>) -> bool[src]

This method tests for !=.

impl<T> Serialize for Local<T>[src]

pub fn serialize<S>(
    &self,
    serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
    S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl<T> Copy for Local<T> where
    T: Copy
[src]

impl<T> Eq for Local<T> where
    T: Eq
[src]

impl<T> StructuralEq for Local<T>[src]

impl<T> StructuralPartialEq for Local<T>[src]

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, P> Access<T> for P where
    P: Deref<Target = A>,
    A: Access<T>, 

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more

pub fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T, A> DynAccess<T> for A where
    A: Access<T>,
    <A as Access<T>>::Guard: 'static, 

pub fn load(&self) -> DynGuard<T>

The equivalent of [Access::load].

impl<T> From<!> for T[src]

pub fn from(t: !) -> T[src]

Performs the conversion.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<C> Config for C where
    C: for<'de> Deserialize<'de> + Send + Sync + Debug + 'static, 
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]