pub struct Timestamp(/* private fields */);Expand description
A point on the wall clock, in nanoseconds since the Unix epoch.
It names a moment another machine can name too, which is what makes it the stamp to capture
with; the clock behind it may step, so a span that must never run backwards is measured on an
Uptime instead. It holds 1677-09-21 to 2262-04-11, and its operators saturate
at either end. It is written as RFC 3339 in UTC, and parses back from it.
§Examples
use t2t_core::{Timedelta, Timestamp};
let published = Timestamp::from_secs(1_700_000_000);
let captured = published + Timedelta::from_micros(850);
assert_eq!(captured - published, Timedelta::from_micros(850), "a point minus a point");
assert_eq!(format!("{captured:.6}"), "2023-11-14T22:13:20.000850Z", "to the microsecond");
let minute = captured.floor(Timedelta::MINUTE);
assert_eq!(format!("{minute:.0}"), "2023-11-14T22:13:00Z", "the minute it falls in");Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn checked_add(self, span: Timedelta) -> Option<Timestamp>
pub const fn checked_add(self, span: Timedelta) -> Option<Timestamp>
The point span later, or None past the range.
Sourcepub const fn checked_sub(self, span: Timedelta) -> Option<Timestamp>
pub const fn checked_sub(self, span: Timedelta) -> Option<Timestamp>
The point span earlier, or None past the range.
Sourcepub const fn checked_since(self, start: Timestamp) -> Option<Timedelta>
pub const fn checked_since(self, start: Timestamp) -> Option<Timedelta>
The span since start, or None past the span’s range.
Sourcepub const fn floor(self, unit: Timedelta) -> Timestamp
pub const fn floor(self, unit: Timedelta) -> Timestamp
The nearest multiple of |unit| at or below the point, or the point for a zero
unit.
Examples found in repository?
20fn main() {
21 // A span is written and read the way a config spells it.
22 let stale = Timedelta::SECOND;
23 println!("stale after {stale}");
24 println!("\"1h30m\" reads as {:?}", "1h30m".parse::<Timedelta>());
25
26 // An instant is a point; the difference of two is a span.
27 let published = Timestamp::from_secs(1_700_000_000);
28 let captured = published + Timedelta::from_micros(850);
29 println!("published {published}");
30 println!("captured {captured:.6}");
31 println!("on the wire {}", captured - published);
32
33 // The same instant, read as a date; and the minute it falls in.
34 let date_time = captured.to_utc();
35 println!(
36 "that is {}-{:02}-{:02}, {} ns past the second",
37 date_time.year, date_time.month, date_time.day, date_time.nanosecond
38 );
39 let minute = captured.floor(Timedelta::MINUTE);
40 println!("its minute {minute:.0} to {:.0}", minute + Timedelta::MINUTE);
41
42 // A value carries the stamp its writer captured it with, and says how old it is.
43 let sample = Timed::new(captured, Weather { celsius: 21, humidity: 40 });
44 let age = sample.elapsed(captured + Timedelta::from_millis(1_500));
45 println!(
46 "sample {} °C, {}%, {age} old, stale: {}",
47 sample.celsius,
48 sample.humidity,
49 age > stale
50 );
51
52 // A counter's ticks mean nothing until a rate says what one is worth.
53 let start = Tickstamp::from_ticks(1_000_000);
54 let ticks = start + Tickdelta::from_ticks(4_250) - start;
55 let rate = TickRate::GIGAHERTZ;
56 println!("counter ran {ticks}: {} at {rate}", ticks.to_timedelta(rate));
57}Source§impl Timestamp
impl Timestamp
Sourcepub const fn from_nanos(nanos: i64) -> Timestamp
pub const fn from_nanos(nanos: i64) -> Timestamp
The point nanos nanoseconds after the Unix epoch.
Sourcepub const fn from_micros(micros: i64) -> Timestamp
pub const fn from_micros(micros: i64) -> Timestamp
The point micros microseconds after the Unix epoch, saturating.
Sourcepub const fn from_millis(millis: i64) -> Timestamp
pub const fn from_millis(millis: i64) -> Timestamp
The point millis milliseconds after the Unix epoch, saturating.
Sourcepub const fn from_secs(secs: i64) -> Timestamp
pub const fn from_secs(secs: i64) -> Timestamp
The point secs seconds after the Unix epoch, saturating.
Examples found in repository?
20fn main() {
21 // A span is written and read the way a config spells it.
22 let stale = Timedelta::SECOND;
23 println!("stale after {stale}");
24 println!("\"1h30m\" reads as {:?}", "1h30m".parse::<Timedelta>());
25
26 // An instant is a point; the difference of two is a span.
27 let published = Timestamp::from_secs(1_700_000_000);
28 let captured = published + Timedelta::from_micros(850);
29 println!("published {published}");
30 println!("captured {captured:.6}");
31 println!("on the wire {}", captured - published);
32
33 // The same instant, read as a date; and the minute it falls in.
34 let date_time = captured.to_utc();
35 println!(
36 "that is {}-{:02}-{:02}, {} ns past the second",
37 date_time.year, date_time.month, date_time.day, date_time.nanosecond
38 );
39 let minute = captured.floor(Timedelta::MINUTE);
40 println!("its minute {minute:.0} to {:.0}", minute + Timedelta::MINUTE);
41
42 // A value carries the stamp its writer captured it with, and says how old it is.
43 let sample = Timed::new(captured, Weather { celsius: 21, humidity: 40 });
44 let age = sample.elapsed(captured + Timedelta::from_millis(1_500));
45 println!(
46 "sample {} °C, {}%, {age} old, stale: {}",
47 sample.celsius,
48 sample.humidity,
49 age > stale
50 );
51
52 // A counter's ticks mean nothing until a rate says what one is worth.
53 let start = Tickstamp::from_ticks(1_000_000);
54 let ticks = start + Tickdelta::from_ticks(4_250) - start;
55 let rate = TickRate::GIGAHERTZ;
56 println!("counter ran {ticks}: {} at {rate}", ticks.to_timedelta(rate));
57}Source§impl Timestamp
impl Timestamp
Sourcepub const UNIX_EPOCH: Timestamp
pub const UNIX_EPOCH: Timestamp
1970-01-01T00:00:00Z, the point the count runs from.
Source§impl Timestamp
impl Timestamp
Sourcepub const fn to_utc(self) -> UtcDateTime
pub const fn to_utc(self) -> UtcDateTime
This point read as a date and a time of day in UTC.
Examples found in repository?
20fn main() {
21 // A span is written and read the way a config spells it.
22 let stale = Timedelta::SECOND;
23 println!("stale after {stale}");
24 println!("\"1h30m\" reads as {:?}", "1h30m".parse::<Timedelta>());
25
26 // An instant is a point; the difference of two is a span.
27 let published = Timestamp::from_secs(1_700_000_000);
28 let captured = published + Timedelta::from_micros(850);
29 println!("published {published}");
30 println!("captured {captured:.6}");
31 println!("on the wire {}", captured - published);
32
33 // The same instant, read as a date; and the minute it falls in.
34 let date_time = captured.to_utc();
35 println!(
36 "that is {}-{:02}-{:02}, {} ns past the second",
37 date_time.year, date_time.month, date_time.day, date_time.nanosecond
38 );
39 let minute = captured.floor(Timedelta::MINUTE);
40 println!("its minute {minute:.0} to {:.0}", minute + Timedelta::MINUTE);
41
42 // A value carries the stamp its writer captured it with, and says how old it is.
43 let sample = Timed::new(captured, Weather { celsius: 21, humidity: 40 });
44 let age = sample.elapsed(captured + Timedelta::from_millis(1_500));
45 println!(
46 "sample {} °C, {}%, {age} old, stale: {}",
47 sample.celsius,
48 sample.humidity,
49 age > stale
50 );
51
52 // A counter's ticks mean nothing until a rate says what one is worth.
53 let start = Tickstamp::from_ticks(1_000_000);
54 let ticks = start + Tickdelta::from_ticks(4_250) - start;
55 let rate = TickRate::GIGAHERTZ;
56 println!("counter ran {ticks}: {} at {rate}", ticks.to_timedelta(rate));
57}Trait Implementations§
Source§impl AddAssign<Timedelta> for Timestamp
impl AddAssign<Timedelta> for Timestamp
Source§fn add_assign(&mut self, span: Timedelta)
fn add_assign(&mut self, span: Timedelta)
+= operation. Read moreimpl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Timestamp, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Timestamp, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for Timestamp
RFC 3339 in UTC, with Z: 2026-09-16T07:45:35.123456789Z.
impl Display for Timestamp
RFC 3339 in UTC, with Z: 2026-09-16T07:45:35.123456789Z.
The precision chooses the fraction’s digits, nine by default and at most nine: {:.3} writes
milliseconds and {:.0} none. A width pads the spelling.
impl Eq for Timestamp
Source§impl From<Timestamp> for UtcDateTime
impl From<Timestamp> for UtcDateTime
Source§fn from(instant: Timestamp) -> UtcDateTime
fn from(instant: Timestamp) -> UtcDateTime
Source§impl FromBytes for Timestamp
impl FromBytes for Timestamp
Source§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>where
Self: KnownLayout + Immutable,
Source§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>where
Self: Immutable + KnownLayout,
&Self. Read moreSource§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>where
Self: IntoBytes + KnownLayout,
Source§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>where
Self: IntoBytes + KnownLayout,
Source§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>where
Self: IntoBytes + KnownLayout,
Source§fn ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>
fn ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>
Source§fn ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>
fn ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>
Source§fn ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>
fn ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, !>>
Source§fn mut_from_bytes_with_elems(
source: &mut [u8],
count: usize,
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>
fn mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>
Source§fn mut_from_prefix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>
fn mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>
Source§fn mut_from_suffix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>
fn mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, !>>
Source§fn read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>where
Self: Sized,
fn read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>where
Self: Sized,
Source§impl FromStr for Timestamp
Reads what Display writes, T and Z in either case, and a fraction of one
to nine digits or none.
impl FromStr for Timestamp
Reads what Display writes, T and Z in either case, and a fraction of one
to nine digits or none.
It refuses an offset, a 60th second, a date that does not exist, and an instant outside 1677-09-21 to 2262-04-11.
Source§impl FromZeros for Timestamp
impl FromZeros for Timestamp
Source§fn new_zeroed() -> Selfwhere
Self: Sized,
fn new_zeroed() -> Selfwhere
Self: Sized,
Self from zeroed bytes. Read moreSource§fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
alloc only.Box<Self> from zeroed bytes. Read moreSource§fn new_box_zeroed_with_elems(count: usize) -> Result<Box<Self>, AllocError>where
Self: KnownLayout<PointerMetadata = usize>,
fn new_box_zeroed_with_elems(count: usize) -> Result<Box<Self>, AllocError>where
Self: KnownLayout<PointerMetadata = usize>,
alloc only.Box<[Self]> (a boxed slice) from zeroed bytes. Read moreSource§fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
alloc only.Vec<Self> from zeroed bytes. Read moreSource§fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
alloc and non-no_zerocopy_panic_in_const_and_vec_try_reserve_1_57_0 only.Vec<Self> by pushing additional new items onto the end of
the vector. The new items are initialized with zeros.Source§fn insert_vec_zeroed(
v: &mut Vec<Self>,
position: usize,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn insert_vec_zeroed(
v: &mut Vec<Self>,
position: usize,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
alloc and non-no_zerocopy_panic_in_const_and_vec_try_reserve_1_57_0 only.additional new items into Vec<Self> at position. The new
items are initialized with zeros. Read moreimpl Immutable for Timestamp
Source§impl IntoBytes for Timestamp
impl IntoBytes for Timestamp
Source§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Source§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§fn write_to_prefix(
&self,
dst: &mut [u8],
) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to_prefix(
&self,
dst: &mut [u8],
) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl JsonSchema for Timestamp
impl JsonSchema for Timestamp
Source§fn json_schema(_generator: &mut SchemaGenerator) -> Schema
fn json_schema(_generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl KnownLayout for Timestamp
impl KnownLayout for Timestamp
Source§type PointerMetadata = ()
type PointerMetadata = ()
Self. Read moreSource§fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
Self with the given pointer
metadata. Read moreSource§impl Ord for Timestamp
impl Ord for Timestamp
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
Source§impl Serialize for Timestamp
impl Serialize for Timestamp
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,
impl StructuralPartialEq for Timestamp
Source§impl SubAssign<Timedelta> for Timestamp
impl SubAssign<Timedelta> for Timestamp
Source§fn sub_assign(&mut self, span: Timedelta)
fn sub_assign(&mut self, span: Timedelta)
-= operation. Read moreSource§impl<Z> TryFrom<DateTime<Z>> for Timestampwhere
Z: TimeZone,
Refuses an instant outside Timestamp::MIN to Timestamp::MAX, in any zone.
impl<Z> TryFrom<DateTime<Z>> for Timestampwhere
Z: TimeZone,
Refuses an instant outside Timestamp::MIN to Timestamp::MAX, in any zone.
Source§impl TryFrom<OffsetDateTime> for Timestamp
Refuses an instant outside Timestamp::MIN to Timestamp::MAX, at any offset.
impl TryFrom<OffsetDateTime> for Timestamp
Refuses an instant outside Timestamp::MIN to Timestamp::MAX, at any offset.
Source§type Error = OutOfRangeError
type Error = OutOfRangeError
Source§fn try_from(
instant: OffsetDateTime,
) -> Result<Timestamp, <Timestamp as TryFrom<OffsetDateTime>>::Error>
fn try_from( instant: OffsetDateTime, ) -> Result<Timestamp, <Timestamp as TryFrom<OffsetDateTime>>::Error>
Source§impl TryFrom<SystemTime> for Timestamp
Refuses a SystemTime outside 1677-09-21 to 2262-04-11.
impl TryFrom<SystemTime> for Timestamp
Refuses a SystemTime outside 1677-09-21 to 2262-04-11.
Source§type Error = OutOfRangeError
type Error = OutOfRangeError
Source§fn try_from(
instant: SystemTime,
) -> Result<Timestamp, <Timestamp as TryFrom<SystemTime>>::Error>
fn try_from( instant: SystemTime, ) -> Result<Timestamp, <Timestamp as TryFrom<SystemTime>>::Error>
Source§impl TryFrom<Timestamp> for Timestamp
Refuses an instant outside Timestamp::MIN to Timestamp::MAX.
impl TryFrom<Timestamp> for Timestamp
Refuses an instant outside Timestamp::MIN to Timestamp::MAX.
Source§impl TryFromBytes for Timestampwhere
i64: TryFromBytes,
impl TryFromBytes for Timestampwhere
i64: TryFromBytes,
Source§fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
Source§fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
Source§fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
Source§fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout + IntoBytes,
Source§fn try_ref_from_bytes_with_elems(
source: &[u8],
count: usize,
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_bytes_with_elems( source: &[u8], count: usize, ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
Source§fn try_ref_from_prefix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_prefix_with_elems( source: &[u8], count: usize, ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
source as a &Self with
a DST length equal to count. Read moreSource§fn try_ref_from_suffix_with_elems(
source: &[u8],
count: usize,
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
fn try_ref_from_suffix_with_elems( source: &[u8], count: usize, ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
source as a &Self with
a DST length equal to count. Read moreSource§fn try_mut_from_bytes_with_elems(
source: &mut [u8],
count: usize,
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_bytes_with_elems( source: &mut [u8], count: usize, ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
Source§fn try_mut_from_prefix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_prefix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
source as a &mut Self
with a DST length equal to count. Read moreSource§fn try_mut_from_suffix_with_elems(
source: &mut [u8],
count: usize,
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
fn try_mut_from_suffix_with_elems( source: &mut [u8], count: usize, ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
source as a &mut Self
with a DST length equal to count. Read more