pub enum Message {
Describe {
version: DataVersion,
reply_limit: u64,
},
Described(Versioned),
Call(Call),
Reply(Reply),
Cancel {
run: RunId,
call: CallRef,
},
NoAnswer {
run: RunId,
call: CallRef,
reason: String,
},
Ack {
run: RunId,
call: CallRef,
result: Ack,
},
Hold {
run: RunId,
call: CallRef,
retry_at: Option<Instant>,
},
Log(Log),
Type {
run: RunId,
call: CallRef,
},
Typed {
run: RunId,
call: CallRef,
answer: Result<ResultType, Untyped>,
},
}Expand description
One message of the protocol, on either route: what one frame’s body holds. Its number is the frame’s kind.
Variants§
Describe
describe, host or client to its peer: its data version and the
largest encoded answer, in bytes, it admits; a client sends 0.
Fields
version: DataVersionThe sender’s data version.
Described(Versioned)
The answer to describe, implementation to host: its data version
and, in that version, each declaration it serves (served).
Call(Call)
call, host to implementation.
Reply(Reply)
reply, implementation or client to host.
Cancel
cancel, host to implementation: a request to stop work on a
call, which proves nothing.
NoAnswer
no_answer, implementation to host: it has no answer to a call.
The call stays open, and the run stops.
Fields
Ack
ack, host to implementation or client: what became of a reply.
Fields
Hold
hold, implementation to host: not an answer, but the promise to
answer the call later. With retry_at, the host asks again then.
Fields
Log(Log)
log, implementation to host: one line for a run’s log.
Type
type, client to host: which type a reply to a call is encoded
at.
Typed
The answer to type, host to client.
Implementations§
Source§impl Message
impl Message
Sourcepub fn described(tools: Vec<(Identity, TypeSpec)>) -> Message
pub fn described(tools: Vec<(Identity, TypeSpec)>) -> Message
The answer to describe serving tools, in this build’s data
version.
Sourcepub fn parse(route: Route, body: &[u8]) -> Result<Message, Malformed>
pub fn parse(route: Route, body: &[u8]) -> Result<Message, Malformed>
The message body holds on route, refusing any other bytes: a
kind the route does not carry, a field that does not read, and bytes
left over. A reply or a hold whose run and call read is
malformed for its call (Malformed::Reply).
§Errors
Malformed, saying which of those it met.
Trait Implementations§
impl Eq for Message
Source§impl Keyed for Message
impl Keyed for Message
Source§fn payload<'a>(&'a self, parts: &mut Vec<&'a dyn AnyWire>)
fn payload<'a>(&'a self, parts: &mut Vec<&'a dyn AnyWire>)
parts, in the order they are
written, without its constructor’s number.Source§fn open_payload(number: u64, at: usize) -> Result<Opened, DecodeError>
fn open_payload(number: u64, at: usize) -> Result<Opened, DecodeError>
Source§fn payload_bytes(&self) -> Vec<u8> ⓘ
fn payload_bytes(&self) -> Vec<u8> ⓘ
Source§fn decode_payload(number: u64, bytes: &[u8]) -> Result<Self, DecodeError>
fn decode_payload(number: u64, bytes: &[u8]) -> Result<Self, DecodeError>
number whose
payload bytes hold, and nothing else. Read moreSource§impl Shaped for Message
impl Shaped for Message
Source§fn write_at(
&self,
catalog: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, catalog: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
catalog: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Self, DecodeError>
fn read_at( catalog: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Self, DecodeError>
impl StructuralPartialEq for Message
Source§impl Wire for Message
impl Wire for Message
Source§fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
out, and pushes
its parts to parts in the order they are written after them.Source§fn open(reader: &mut Reader<'_>) -> Result<Opened, DecodeError>
fn open(reader: &mut Reader<'_>) -> Result<Opened, DecodeError>
reader: the value itself when it has no parts,
else its parts to read and what joins them. Read moreSource§fn write(&self, out: &mut Vec<u8>)
fn write(&self, out: &mut Vec<u8>)
out: its head, and then each part’s bytes in
order, written over a stack on the heap, so a value nested however
deep is written on a native stack of fixed size.Auto Trait Implementations§
impl !Freeze for Message
impl Forget for Message
impl Move for Message
impl RefUnwindSafe for Messagewhere
NonZero<u64>: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
Mutex<HashMap<(Type, Settings), Option<String>>>: RefUnwindSafe,
impl Send for Messagewhere
RawVecInner: Send,
NonZero<u64>: Send,
BoxRaw<Term>: Send,
Arc<RecordShape>: Send,
BoxRaw<Type>: Send,
Arc<EnumShape>: Send,
Mutex<HashMap<(Type, Settings), Option<String>>>: Send,
RawTable<(Box<str>, usize)>: Send,
BoxRaw<[usize]>: Send,
BoxRaw<[Option<OptionCtor>]>: Send,
BoxRaw<[Option<JsonValueCtor>]>: Send,
Arc<[u8]>: Send,
impl Sync for Messagewhere
RawVecInner: Sync,
NonZero<u64>: Sync,
BoxRaw<Term>: Sync,
Arc<RecordShape>: Sync,
BoxRaw<Type>: Sync,
Arc<EnumShape>: Sync,
Mutex<HashMap<(Type, Settings), Option<String>>>: Sync,
RawTable<(Box<str>, usize)>: Sync,
BoxRaw<[usize]>: Sync,
BoxRaw<[Option<OptionCtor>]>: Sync,
BoxRaw<[Option<JsonValueCtor>]>: Sync,
Arc<[u8]>: Sync,
impl Unpin for Messagewhere
*const u8 is !null: Unpin,
NonZero<u64>: Unpin,
Box<Term>: Unpin,
Arc<RecordShape>: Unpin,
Box<Type>: Unpin,
Arc<EnumShape>: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
Box<str>: Unpin,
Box<[usize]>: Unpin,
Box<[Option<OptionCtor>]>: Unpin,
Box<[Option<JsonValueCtor>]>: Unpin,
Arc<[u8]>: Unpin,
impl UnsafeUnpin for Messagewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<NonZero<u64>>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
PhantomData<(String, Term)>: UnsafeUnpin,
*const Term is !null: UnsafeUnpin,
PhantomData<Term>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<Template>: UnsafeUnpin,
PhantomData<Decl>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<((Type, Settings), Option<String>)>: UnsafeUnpin,
PhantomData<Names>: UnsafeUnpin,
*const ArcInner<EnumShape> is !null: UnsafeUnpin,
PhantomData<ArcInner<EnumShape>>: UnsafeUnpin,
*const [usize] is !null: UnsafeUnpin,
PhantomData<[usize]>: UnsafeUnpin,
*const [Option<OptionCtor>] is !null: UnsafeUnpin,
PhantomData<[Option<OptionCtor>]>: UnsafeUnpin,
*const [Option<JsonValueCtor>] is !null: UnsafeUnpin,
PhantomData<[Option<JsonValueCtor>]>: UnsafeUnpin,
*const Type is !null: UnsafeUnpin,
PhantomData<Type>: UnsafeUnpin,
*const ArcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u8]>>: UnsafeUnpin,
impl UnwindSafe for Messagewhere
RawVecInner: UnwindSafe,
NonZero<u64>: UnwindSafe,
BoxRaw<Term>: UnwindSafe,
Arc<RecordShape>: UnwindSafe,
BoxRaw<Type>: UnwindSafe,
Arc<EnumShape>: UnwindSafe,
Mutex<HashMap<(Type, Settings), Option<String>>>: UnwindSafe,
HashMap<Box<str>, usize>: UnwindSafe,
BoxRaw<[usize]>: UnwindSafe,
BoxRaw<[Option<OptionCtor>]>: UnwindSafe,
BoxRaw<[Option<JsonValueCtor>]>: UnwindSafe,
Arc<[u8]>: UnwindSafe,
Blanket Implementations§
Source§impl<T> AnyWire for Twhere
T: Wire,
impl<T> AnyWire for Twhere
T: Wire,
Source§fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
Wire::write_head.