pub struct RunId { /* private fields */ }Expand description
A run’s id: 128 bits, written as exactly 32 lowercase hexadecimal digits.
Text becomes one only through RunId::parse, so an id read from a
history, a frame or a command line that has any other form is refused
where it is read. Ids order as their written digits do. It keeps its
digits beside its bits, so it is Copy and lends them as text without
allocating.
Implementations§
Source§impl RunId
impl RunId
Sourcepub fn parse(text: &str) -> Result<RunId, ParsePlaceError>
pub fn parse(text: &str) -> Result<RunId, ParsePlaceError>
The run id text is.
§Errors
A ParsePlaceError when text is not exactly 32 lowercase
hexadecimal digits.
Sourcepub fn bits(&self) -> [u8; 16]
pub fn bits(&self) -> [u8; 16]
Its 16 bits, most significant byte first, as RunId::from_bits
reads them.
Trait Implementations§
impl Copy for RunId
Source§impl<'de> Deserialize<'de> for RunId
impl<'de> Deserialize<'de> for RunId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<RunId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<RunId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RunId
Source§impl Ord for RunId
impl Ord for RunId
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 RunId
impl PartialOrd for RunId
Source§impl Serialize for RunId
impl Serialize for RunId
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Shaped for RunId
impl Shaped for RunId
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<RunId, DecodeError>
fn read_at( input: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<RunId, DecodeError>
impl StructuralPartialEq for RunId
Source§impl Wire for RunId
A run id is its 16 bits, most significant byte first, with no length
(abi.md, Numbers and text).
impl Wire for RunId
A run id is its 16 bits, most significant byte first, with no length
(abi.md, Numbers and text).
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 Forget for RunId
impl Freeze for RunId
impl Move for RunId
impl RefUnwindSafe for RunId
impl Send for RunId
impl Sync for RunId
impl Unpin for RunId
impl UnsafeUnpin for RunId
impl UnwindSafe for RunId
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