pub trait Decode {
const ID: u64 = 0;
// Required method
fn decode(
buf: Bytes,
ctx: Option<&DecodeContext>,
) -> Result<Self, DecodeError>
where Self: Sized;
}Expand description
Describes how to decode a remote message.
Provided Associated Constants§
Sourceconst ID: u64 = 0
const ID: u64 = 0
Message identifier. A remote message should have an unique identifier so the
Handler<RemoteMessage> can dispatch the message to the proper handler.
Here unique means that for one particular actor type, the messages that can be handled
by it must have unique identifiers, but two different actor can have messages share the
same identifier.
The identifier in Encode and Decode must be the same for the same message type.
The derived implementation of Handler<RemoteMessage> relies on this identifier to work
properly. If you do not use the derived implementation of Handler<RemoteMessage>, you
can ignore this requirement and just use the default value.
(u64::MAX - 255) ~ u64::MAX is reserved for internal use.
Required Methods§
Sourcefn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>where
Self: Sized,
Decodes the remote message from the provided buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Decode for CronSignal
impl Decode for CronSignal
Source§impl Decode for bool
Available on crate feature prost-codec only.
impl Decode for bool
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for f32
Available on crate feature prost-codec only.
impl Decode for f32
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for f64
Available on crate feature prost-codec only.
impl Decode for f64
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for i8
Available on crate feature prost-codec only.
impl Decode for i8
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for i16
Available on crate feature prost-codec only.
impl Decode for i16
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for i32
Available on crate feature prost-codec only.
impl Decode for i32
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for i64
Available on crate feature prost-codec only.
impl Decode for i64
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for isize
Available on crate feature prost-codec only.
impl Decode for isize
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for u8
Available on crate feature prost-codec only.
impl Decode for u8
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for u16
Available on crate feature prost-codec only.
impl Decode for u16
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for u32
Available on crate feature prost-codec only.
impl Decode for u32
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for u64
Available on crate feature prost-codec only.
impl Decode for u64
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for ()
Available on crate feature prost-codec only.
impl Decode for ()
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for usize
Available on crate feature prost-codec only.
impl Decode for usize
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for String
Available on crate feature prost-codec only.
impl Decode for String
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<bool>
Available on crate feature prost-codec only.
impl Decode for Vec<bool>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<f32>
Available on crate feature prost-codec only.
impl Decode for Vec<f32>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<f64>
Available on crate feature prost-codec only.
impl Decode for Vec<f64>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<i8>
Available on crate feature prost-codec only.
impl Decode for Vec<i8>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<i16>
Available on crate feature prost-codec only.
impl Decode for Vec<i16>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<i32>
Available on crate feature prost-codec only.
impl Decode for Vec<i32>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<i64>
Available on crate feature prost-codec only.
impl Decode for Vec<i64>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<isize>
Available on crate feature prost-codec only.
impl Decode for Vec<isize>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<u8>
Available on crate feature prost-codec only.
impl Decode for Vec<u8>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<u16>
Available on crate feature prost-codec only.
impl Decode for Vec<u16>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<u32>
Available on crate feature prost-codec only.
impl Decode for Vec<u32>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<u64>
Available on crate feature prost-codec only.
impl Decode for Vec<u64>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for Vec<usize>
Available on crate feature prost-codec only.
impl Decode for Vec<usize>
prost-codec only.fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl Decode for IpcMessage
impl Decode for IpcMessage
fn decode(buf: Bytes, _ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<A> Decode for Supervisor<A>where
A: Actor,
impl<A> Decode for Supervisor<A>where
A: Actor,
Source§impl<T0, T1> Decode for (T0, T1)
Available on crate feature prost-codec only.
impl<T0, T1> Decode for (T0, T1)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2> Decode for (T0, T1, T2)
Available on crate feature prost-codec only.
impl<T0, T1, T2> Decode for (T0, T1, T2)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3> Decode for (T0, T1, T2, T3)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3> Decode for (T0, T1, T2, T3)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3, T4> Decode for (T0, T1, T2, T3, T4)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3, T4> Decode for (T0, T1, T2, T3, T4)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3, T4, T5> Decode for (T0, T1, T2, T3, T4, T5)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3, T4, T5> Decode for (T0, T1, T2, T3, T4, T5)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3, T4, T5, T6> Decode for (T0, T1, T2, T3, T4, T5, T6)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3, T4, T5, T6> Decode for (T0, T1, T2, T3, T4, T5, T6)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7> Decode for (T0, T1, T2, T3, T4, T5, T6, T7)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3, T4, T5, T6, T7> Decode for (T0, T1, T2, T3, T4, T5, T6, T7)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Decode for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Decode for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
prost-codec only.fn decode(buf: Bytes, ctx: Option<&DecodeContext>) -> Result<Self, DecodeError>
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Decode for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Available on crate feature prost-codec only.
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Decode for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
prost-codec only.