pub struct Identity {
pub library: Option<Library>,
pub module: String,
pub name: String,
}Expand description
An identity as a description writes it (abi.md, Identity and
signatures): the library that holds the declaration, the module
path in it and the declaration’s name.
Fields§
§library: Option<Library>The library, or the tree for a module outside every library;
None for the local tree or a bundle.
module: StringThe module path in the library or tree; empty for a root module.
name: StringThe declaration’s name.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn identity(&self) -> Result<Declared, SegmentsError>
pub fn identity(&self) -> Result<Declared, SegmentsError>
The identity these parts write: the module whose library and module
path are these parts, so that writing it again gives them back. A
library with a version is a repository, or std; one without is a
library of the local tree, . its root; and no library is the
tree outside every library.
§Errors
The module path, or a library root of the local tree, that is no path.
Trait Implementations§
impl Eq for Identity
Source§impl Ord for Identity
impl Ord for Identity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Identity
impl PartialOrd for Identity
Source§impl Shaped for Identity
impl Shaped for Identity
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>
impl StructuralPartialEq for Identity
Source§impl Wire for Identity
impl Wire for Identity
Source§fn write_head<'a>(&'a self, _: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, _: &mut Vec<u8>, parts: &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(_: &mut Reader<'_>) -> Result<Opened, DecodeError>
fn open(_: &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 Forget for Identity
impl Freeze for Identity
impl Move for Identity
impl RefUnwindSafe for Identity
impl Send for Identitywhere
RawVecInner: Send,
impl Sync for Identitywhere
RawVecInner: Sync,
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identitywhere
RawVecInner: 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