MethodCallWrapper

Struct MethodCallWrapper 

Source
pub struct MethodCallWrapper<M, P>{
    pub method: M,
    pub ext: P,
}
Expand description

This special bundle’s element can be used to call a method either on the server or on the client. Its interface is quite complicated, so it’s only internal and must be used through public functions.

Fields§

§method: M

The actual wrapped method call.

§ext: P

The extension element that is encoded or decoded just before the actual method call.

Implementations§

Source§

impl<M, P> MethodCallWrapper<M, P>

Source

pub const DEFAULT_LEN: ElementLength

The length type to use if now particular length is required, this length defaults to a callback which returns a length depending on the id and the use of sub-slot to represent the method’s id.

Source

pub fn new(method: M, prefix: P) -> Self

Source

pub fn write(self, writer: BundleElementWriter<'_>)

Source

pub fn read( reader: TopElementReader<'_, '_>, ) -> BundleResult<BundleElement<Self>>

Trait Implementations§

Source§

impl<M, P> Element for MethodCallWrapper<M, P>

Source§

type Config = (u8, Option<u8>)

This contains (elt_id, sub_id):

  • Element id is required when decoding;
  • Sub id optional when encoding.
Source§

fn encode(&self, write: &mut impl Write, config: &Self::Config) -> Result<()>

Encode the element with the given writer and the given configuration.
Source§

fn decode( read: &mut impl Read, len: usize, config: &Self::Config, ) -> Result<Self>

Decode the element from the given reader and the given configuration. Read more
Source§

impl<M, P> TopElement for MethodCallWrapper<M, P>

Source§

const LEN: ElementLength = P::LEN

The type of length that prefixes the element’s content and describe how much space is taken by the element.

Auto Trait Implementations§

§

impl<M, P> Freeze for MethodCallWrapper<M, P>
where M: Freeze, P: Freeze,

§

impl<M, P> RefUnwindSafe for MethodCallWrapper<M, P>

§

impl<M, P> Send for MethodCallWrapper<M, P>
where M: Send, P: Send,

§

impl<M, P> Sync for MethodCallWrapper<M, P>
where M: Sync, P: Sync,

§

impl<M, P> Unpin for MethodCallWrapper<M, P>
where M: Unpin, P: Unpin,

§

impl<M, P> UnwindSafe for MethodCallWrapper<M, P>
where M: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V