pub struct Time(/* private fields */);
Expand description
Time is as the number of nanoseconds since the Unix epoch. The default value of Time is the Unix epoch 1970-01-01 00:00:00 UTC. This default may not be suitable for all applications, so wrap time in an Option.
Implementations§
Source§impl Time
impl Time
Sourcepub const fn from_unix_nanos(time: i128) -> Time
pub const fn from_unix_nanos(time: i128) -> Time
Constructs a time instance with nanoseconds since the Unix epoch.
Sourcepub const fn from_unix_secs(time: i64) -> Time
pub const fn from_unix_secs(time: i64) -> Time
Constructs a time instance with seconds since the Unix epoch.
Sourcepub const fn unix_nanos(&self) -> i128
pub const fn unix_nanos(&self) -> i128
Returns the number of nanoseconds since the Unix epoch.
Trait Implementations§
Source§impl AddAssign<Duration> for Time
impl AddAssign<Duration> for Time
Source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+=
operation. Read moreSource§impl KeyFieldValue for Time
impl KeyFieldValue for Time
Source§fn encode<'a>(
key: &<Time as ObjectFieldValue>::In<'a>,
writer: &mut ReverseSliceWriter<'_>,
) -> Result<(), EncodeError>
fn encode<'a>( key: &<Time as ObjectFieldValue>::In<'a>, writer: &mut ReverseSliceWriter<'_>, ) -> Result<(), EncodeError>
Encode the key segment as a non-terminal segment.
Source§fn decode<'a>(
reader: &mut &'a [u8],
memory_manager: &'a MemoryManager,
) -> Result<<Time as ObjectFieldValue>::Out<'a>, DecodeError>
fn decode<'a>( reader: &mut &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<<Time as ObjectFieldValue>::Out<'a>, DecodeError>
Decode the key segment as a non-terminal segment.
Source§fn out_size<'a>(key: &<Time as ObjectFieldValue>::In<'a>) -> usize
fn out_size<'a>(key: &<Time as ObjectFieldValue>::In<'a>) -> usize
Get the size of the key segment as a non-terminal segment.
Source§fn encode_terminal<'a>(
key: &Self::In<'a>,
writer: &mut ReverseSliceWriter<'_>,
) -> Result<(), EncodeError>
fn encode_terminal<'a>( key: &Self::In<'a>, writer: &mut ReverseSliceWriter<'_>, ) -> Result<(), EncodeError>
Encode the key segment as the terminal segment.
Source§fn decode_terminal<'a>(
reader: &mut &'a [u8],
memory_manager: &'a MemoryManager,
) -> Result<Self::Out<'a>, DecodeError>
fn decode_terminal<'a>( reader: &mut &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<Self::Out<'a>, DecodeError>
Decode the key segment as the terminal segment.
Source§fn out_size_terminal<'a>(key: &Self::In<'a>) -> usize
fn out_size_terminal<'a>(key: &Self::In<'a>) -> usize
Get the size of the key segment as the terminal segment.
Source§impl ObjectFieldValue for Time
impl ObjectFieldValue for Time
Source§impl Ord for Time
impl Ord for Time
Source§impl PartialOrd for Time
impl PartialOrd for Time
Source§impl<'a> SchemaValue<'a> for Time
impl<'a> SchemaValue<'a> for Time
Source§type DecodeState = Time
type DecodeState = Time
In progress decoding state.
Source§fn visit_decode_state(
state: &mut <Time as SchemaValue<'a>>::DecodeState,
decoder: &mut dyn Decoder<'a>,
) -> Result<(), DecodeError>
fn visit_decode_state( state: &mut <Time as SchemaValue<'a>>::DecodeState, decoder: &mut dyn Decoder<'a>, ) -> Result<(), DecodeError>
Decode the value from the decoder.
Source§fn finish_decode_state(
state: <Time as SchemaValue<'a>>::DecodeState,
_: &'a MemoryManager,
) -> Result<Time, DecodeError>
fn finish_decode_state( state: <Time as SchemaValue<'a>>::DecodeState, _: &'a MemoryManager, ) -> Result<Time, DecodeError>
Finish decoding the value, return it and return the memory handle if needed.
Source§impl SubAssign<Duration> for Time
impl SubAssign<Duration> for Time
Source§fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the
-=
operation. Read moreimpl Copy for Time
impl Eq for Time
impl<'a> ListElementValue<'a> for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> ObjectKey for Awhere
A: KeyFieldValue,
impl<A> ObjectKey for Awhere
A: KeyFieldValue,
Source§fn encode<'a>(
key: &<A as ObjectValue>::In<'a>,
writer: &mut ReverseSliceWriter<'_>,
) -> Result<(), EncodeError>
fn encode<'a>( key: &<A as ObjectValue>::In<'a>, writer: &mut ReverseSliceWriter<'_>, ) -> Result<(), EncodeError>
Encode the key.
Source§fn decode<'a>(
input: &'a [u8],
memory_manager: &'a MemoryManager,
) -> Result<<A as ObjectValue>::Out<'a>, DecodeError>
fn decode<'a>( input: &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<<A as ObjectValue>::Out<'a>, DecodeError>
Decode the key.
Source§impl<A> ObjectValue for Awhere
A: ObjectFieldValue,
impl<A> ObjectValue for Awhere
A: ObjectFieldValue,
Source§const PSEUDO_TYPE: StructType<'static>
const PSEUDO_TYPE: StructType<'static>
The associated “pseudo-struct” type for the object value.
Source§type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type,)
type FieldTypes<'a> = (<<A as ObjectFieldValue>::In<'a> as SchemaValue<'a>>::Type,)
The object value types as field types.
Source§type In<'a> = <A as ObjectFieldValue>::In<'a>
type In<'a> = <A as ObjectFieldValue>::In<'a>
The type that is used when inputting object values to functions.
Source§type Out<'a> = <A as ObjectFieldValue>::Out<'a>
type Out<'a> = <A as ObjectFieldValue>::Out<'a>
The type that is used in function return values.
Source§fn encode<'a>(
value: &<A as ObjectValue>::In<'a>,
encoder: &mut dyn Encoder,
) -> Result<(), EncodeError>
fn encode<'a>( value: &<A as ObjectValue>::In<'a>, encoder: &mut dyn Encoder, ) -> Result<(), EncodeError>
Encode each part of the value in reverse order.
Source§fn decode<'a>(
decoder: &mut dyn Decoder<'a>,
mem: &'a MemoryManager,
) -> Result<<A as ObjectValue>::Out<'a>, DecodeError>
fn decode<'a>( decoder: &mut dyn Decoder<'a>, mem: &'a MemoryManager, ) -> Result<<A as ObjectValue>::Out<'a>, DecodeError>
Decode the value from the decoder.
Source§impl<'a, V> OptionalValue<'a> for Vwhere
V: SchemaValue<'a>,
impl<'a, V> OptionalValue<'a> for Vwhere
V: SchemaValue<'a>,
Source§fn decode_value(
cdc: &dyn Codec,
data: &'a [u8],
memory_manager: &'a MemoryManager,
) -> Result<<V as OptionalValue<'a>>::Value, DecodeError>
fn decode_value( cdc: &dyn Codec, data: &'a [u8], memory_manager: &'a MemoryManager, ) -> Result<<V as OptionalValue<'a>>::Value, DecodeError>
Decode the value.
Source§fn encode_value<'b>(
cdc: &dyn Codec,
value: &<V as OptionalValue<'a>>::Value,
writer_factory: &'b dyn WriterFactory,
) -> Result<Option<&'b [u8]>, EncodeError>
fn encode_value<'b>( cdc: &dyn Codec, value: &<V as OptionalValue<'a>>::Value, writer_factory: &'b dyn WriterFactory, ) -> Result<Option<&'b [u8]>, EncodeError>
Encode the value.