pub struct Timedelta(/* private fields */);Expand description
A signed span of nanoseconds: how far apart two points on one timeline are.
Its operators saturate at MIN and MAX, about 292 years either
way, and each has a checked_* twin. It is written coarsest unit first, the way a config spells
it, and parses back from the same spelling.
§Examples
use t2t_core::Timedelta;
let budget = Timedelta::from_millis(250);
assert_eq!(budget.as_micros(), 250_000, "the same span, counted finer");
assert_eq!(budget.to_string(), "250ms", "written in its coarsest unit");
assert_eq!("1m0s250ms".parse(), Ok(Timedelta::MINUTE + budget), "and read back");Implementations§
Source§impl Timedelta
impl Timedelta
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Whether the span runs backwards.
Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Whether the span runs forwards.
Sourcepub const fn checked_add(self, other: Timedelta) -> Option<Timedelta>
pub const fn checked_add(self, other: Timedelta) -> Option<Timedelta>
The sum, or None past the range.
Sourcepub const fn checked_sub(self, other: Timedelta) -> Option<Timedelta>
pub const fn checked_sub(self, other: Timedelta) -> Option<Timedelta>
The difference, or None past the range.
Sourcepub const fn checked_mul(self, factor: i64) -> Option<Timedelta>
pub const fn checked_mul(self, factor: i64) -> Option<Timedelta>
The span factor times over, or None past the range.
Sourcepub const fn checked_div(self, parts: i64) -> Option<Timedelta>
pub const fn checked_div(self, parts: i64) -> Option<Timedelta>
One of parts equal parts, truncated toward zero, or None for no parts, or for
MIN in -1.
Sourcepub const fn checked_neg(self) -> Option<Timedelta>
pub const fn checked_neg(self) -> Option<Timedelta>
The span backwards, or None for MIN.
Sourcepub const fn checked_abs(self) -> Option<Timedelta>
pub const fn checked_abs(self) -> Option<Timedelta>
The span forwards, or None for MIN.
Source§impl Timedelta
impl Timedelta
Sourcepub const NANOSECOND: Timedelta
pub const NANOSECOND: Timedelta
One nanosecond, the finest span the count resolves.
Sourcepub const MICROSECOND: Timedelta
pub const MICROSECOND: Timedelta
One microsecond.
Sourcepub const MILLISECOND: Timedelta
pub const MILLISECOND: Timedelta
One millisecond.
Sourcepub const fn from_nanos(nanos: i64) -> Timedelta
pub const fn from_nanos(nanos: i64) -> Timedelta
A span of nanos nanoseconds.
Sourcepub const fn from_micros(micros: i64) -> Timedelta
pub const fn from_micros(micros: i64) -> Timedelta
A span of micros microseconds, 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}Sourcepub const fn from_millis(millis: i64) -> Timedelta
pub const fn from_millis(millis: i64) -> Timedelta
A span of millis milliseconds, 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}Sourcepub const fn from_hours(hours: i64) -> Timedelta
pub const fn from_hours(hours: i64) -> Timedelta
A span of hours hours, saturating.
Sourcepub const fn subsec_nanos(self) -> i32
pub const fn subsec_nanos(self) -> i32
The nanoseconds past the whole seconds, signed as the span is.
Sourcepub const fn subsec_micros(self) -> i32
pub const fn subsec_micros(self) -> i32
The whole microseconds past the whole seconds, signed as the span is.
Sourcepub const fn subsec_millis(self) -> i32
pub const fn subsec_millis(self) -> i32
The whole milliseconds past the whole seconds, signed as the span is.
Sourcepub const fn to_tickdelta(self, rate: TickRate) -> Tickdelta
pub const fn to_tickdelta(self, rate: TickRate) -> Tickdelta
How many ticks the span lasts at rate: a multiply and a shift, to within a tick.
Trait Implementations§
Source§impl Add<Timedelta> for TaiTimestamp
impl Add<Timedelta> for TaiTimestamp
Source§type Output = TaiTimestamp
type Output = TaiTimestamp
+ operator.Source§impl Add<Timedelta> for BootUptime
impl Add<Timedelta> for BootUptime
Source§type Output = BootUptime
type Output = BootUptime
+ operator.Source§impl AddAssign for Timedelta
impl AddAssign for Timedelta
Source§fn add_assign(&mut self, other: Timedelta)
fn add_assign(&mut self, other: Timedelta)
+= operation. Read moreSource§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 moreSource§impl AddAssign<Timedelta> for TaiTimestamp
impl AddAssign<Timedelta> for TaiTimestamp
Source§fn add_assign(&mut self, span: Timedelta)
fn add_assign(&mut self, span: Timedelta)
+= operation. Read moreSource§impl AddAssign<Timedelta> for Uptime
impl AddAssign<Timedelta> for Uptime
Source§fn add_assign(&mut self, span: Timedelta)
fn add_assign(&mut self, span: Timedelta)
+= operation. Read moreSource§impl AddAssign<Timedelta> for RawUptime
impl AddAssign<Timedelta> for RawUptime
Source§fn add_assign(&mut self, span: Timedelta)
fn add_assign(&mut self, span: Timedelta)
+= operation. Read moreSource§impl AddAssign<Timedelta> for BootUptime
impl AddAssign<Timedelta> for BootUptime
Source§fn add_assign(&mut self, span: Timedelta)
fn add_assign(&mut self, span: Timedelta)
+= operation. Read moreimpl Copy for Timedelta
Source§impl<'de> Deserialize<'de> for Timedelta
impl<'de> Deserialize<'de> for Timedelta
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Timedelta, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Timedelta, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for Timedelta
Coarsest unit first, once each, 0s for zero: 1d2h, 1m0s250ms, -3us.
impl Display for Timedelta
Coarsest unit first, once each, 0s for zero: 1d2h, 1m0s250ms, -3us.
impl Eq for Timedelta
Source§impl FromBytes for Timedelta
impl FromBytes for Timedelta
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 Timedelta
Reads what Display writes, and the bare 0: each unit at most once and
coarsest first, with any count in each, so 48h reads as the span 2d spells.
impl FromStr for Timedelta
Reads what Display writes, and the bare 0: each unit at most once and
coarsest first, with any count in each, so 48h reads as the span 2d spells.
Source§impl FromZeros for Timedelta
impl FromZeros for Timedelta
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 Timedelta
Source§impl IntoBytes for Timedelta
impl IntoBytes for Timedelta
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 Timedelta
impl JsonSchema for Timedelta
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 Timedelta
impl KnownLayout for Timedelta
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 MulAssign<i64> for Timedelta
impl MulAssign<i64> for Timedelta
Source§fn mul_assign(&mut self, factor: i64)
fn mul_assign(&mut self, factor: i64)
*= operation. Read moreSource§impl Ord for Timedelta
impl Ord for Timedelta
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 Timedelta
impl PartialOrd for Timedelta
Source§impl Serialize for Timedelta
impl Serialize for Timedelta
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 Timedelta
Source§impl Sub<Timedelta> for TaiTimestamp
impl Sub<Timedelta> for TaiTimestamp
Source§type Output = TaiTimestamp
type Output = TaiTimestamp
- operator.Source§impl Sub<Timedelta> for BootUptime
impl Sub<Timedelta> for BootUptime
Source§type Output = BootUptime
type Output = BootUptime
- operator.Source§impl SubAssign for Timedelta
impl SubAssign for Timedelta
Source§fn sub_assign(&mut self, other: Timedelta)
fn sub_assign(&mut self, other: Timedelta)
-= operation. Read moreSource§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 SubAssign<Timedelta> for TaiTimestamp
impl SubAssign<Timedelta> for TaiTimestamp
Source§fn sub_assign(&mut self, span: Timedelta)
fn sub_assign(&mut self, span: Timedelta)
-= operation. Read moreSource§impl SubAssign<Timedelta> for Uptime
impl SubAssign<Timedelta> for Uptime
Source§fn sub_assign(&mut self, span: Timedelta)
fn sub_assign(&mut self, span: Timedelta)
-= operation. Read moreSource§impl SubAssign<Timedelta> for RawUptime
impl SubAssign<Timedelta> for RawUptime
Source§fn sub_assign(&mut self, span: Timedelta)
fn sub_assign(&mut self, span: Timedelta)
-= operation. Read moreSource§impl SubAssign<Timedelta> for BootUptime
impl SubAssign<Timedelta> for BootUptime
Source§fn sub_assign(&mut self, span: Timedelta)
fn sub_assign(&mut self, span: Timedelta)
-= operation. Read moreSource§impl TryFrom<SignedDuration> for Timedelta
Refuses a duration past Timedelta::MIN or Timedelta::MAX.
impl TryFrom<SignedDuration> for Timedelta
Refuses a duration past Timedelta::MIN or Timedelta::MAX.
Source§type Error = OutOfRangeError
type Error = OutOfRangeError
Source§fn try_from(
duration: SignedDuration,
) -> Result<Timedelta, <Timedelta as TryFrom<SignedDuration>>::Error>
fn try_from( duration: SignedDuration, ) -> Result<Timedelta, <Timedelta as TryFrom<SignedDuration>>::Error>
Source§impl TryFrom<SignedDuration> for Timedelta
Refuses a duration past Timedelta::MIN or Timedelta::MAX.
impl TryFrom<SignedDuration> for Timedelta
Refuses a duration past Timedelta::MIN or Timedelta::MAX.
Source§type Error = OutOfRangeError
type Error = OutOfRangeError
Source§fn try_from(
duration: SignedDuration,
) -> Result<Timedelta, <Timedelta as TryFrom<SignedDuration>>::Error>
fn try_from( duration: SignedDuration, ) -> Result<Timedelta, <Timedelta as TryFrom<SignedDuration>>::Error>
Source§impl TryFrom<TimeDelta> for Timedelta
Refuses a duration past Timedelta::MIN or Timedelta::MAX.
impl TryFrom<TimeDelta> for Timedelta
Refuses a duration past Timedelta::MIN or Timedelta::MAX.
Source§impl TryFromBytes for Timedeltawhere
i64: TryFromBytes,
impl TryFromBytes for Timedeltawhere
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