pub struct ResultType { /* private fields */ }Expand description
The concrete result type of one call, for a client that answers it from
outside the call (abi.md, Type descriptions and Replies from outside
a call): the type and the templates it reaches, validated.
Implementations§
Source§impl ResultType
impl ResultType
Sourcepub fn from_catalog(
catalog: &Catalog,
result: &Type,
) -> Result<Self, EncodeError>
pub fn from_catalog( catalog: &Catalog, result: &Type, ) -> Result<Self, EncodeError>
The description of result, a concrete type catalog names.
§Errors
An EncodeError when result has no term, names a type
parameter, or the description does not validate.
Sourcepub fn read(bytes: &[u8]) -> Result<Self, DecodeError>
pub fn read(bytes: &[u8]) -> Result<Self, DecodeError>
The description bytes hold, and nothing else.
§Errors
A DecodeError when the bytes are not one valid ResultType.
Sourcepub fn read_from(reader: &mut Reader<'_>) -> Result<Self, DecodeError>
pub fn read_from(reader: &mut Reader<'_>) -> Result<Self, DecodeError>
The description at reader, which it reads past.
§Errors
A DecodeError when the bytes there are not a valid ResultType.
Trait Implementations§
Source§impl Clone for ResultType
impl Clone for ResultType
Source§impl Debug for ResultType
impl Debug for ResultType
impl Eq for ResultType
Source§impl PartialEq for ResultType
impl PartialEq for ResultType
Source§impl Shaped for ResultType
As TypeSpec’s: the bytes it was read from, read and validated by
ResultType::read_from.
impl Shaped for ResultType
As TypeSpec’s: the bytes it was read from, read and validated by
ResultType::read_from.
Source§fn write_at(
&self,
out: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, out: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
input: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Self, DecodeError>
fn read_at( input: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Self, DecodeError>
Source§impl Wire for ResultType
impl Wire for ResultType
Source§fn write_head<'a>(&'a self, out: &mut Vec<u8>, _: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, out: &mut Vec<u8>, _: &mut Vec<&'a dyn AnyWire>)
Appends the bytes it writes before its parts to
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>
Reads its head at
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>)
Appends its bytes to
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 ResultType
impl Forget for ResultType
impl Move for ResultType
impl RefUnwindSafe for ResultTypewhere
Atomic<usize>: RefUnwindSafe,
Mutex<HashMap<(Type, Settings), Option<String>>>: RefUnwindSafe,
impl Send for ResultType
impl Sync for ResultType
impl Unpin for ResultType
impl UnsafeUnpin for ResultTypewhere
*const u8 is !null: 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 ResultTypewhere
RawVecInner: 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>)
As
Wire::write_head.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more