pub struct Duration {
pub seconds: i64,
pub nanos: i32,
pub special_fields: SpecialFields,
}
Fields§
§seconds: i64
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
nanos: i32
Signed fractions of a second at nanosecond resolution of the span
of time. Durations less than one second are represented with a 0
seconds
field and a positive or negative nanos
field. For durations
of one second or more, a non-zero value for the nanos
field must be
of the same sign as the seconds
field. Must be from -999,999,999
to +999,999,999 inclusive.
special_fields: SpecialFields
Implementations§
Trait Implementations§
Source§impl From<Duration> for Duration
impl From<Duration> for Duration
Convert from std::time::Duration
.
§Panics
If std::time::Duration
value is outside of Duration
supported range.
Source§impl Into<Duration> for Duration
impl Into<Duration> for Duration
Convert to std::time::Duration
.
This conversion might be lossy if std::time::Duration
precision is smaller than nanoseconds.
§Panics
If Duration
value is outside of std::time::Duration
supported range.
Source§impl Message for Duration
impl Message for Duration
Source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
true
for protobuf 3.Source§fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
Source§fn compute_size(&self) -> u64
fn compute_size(&self) -> u64
Source§fn write_to_with_cached_sizes(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<()>
fn write_to_with_cached_sizes( &self, os: &mut CodedOutputStream<'_>, ) -> Result<()>
Source§fn special_fields(&self) -> &SpecialFields
fn special_fields(&self) -> &SpecialFields
Source§fn mut_special_fields(&mut self) -> &mut SpecialFields
fn mut_special_fields(&mut self) -> &mut SpecialFields
Source§fn default_instance() -> &'static Duration
fn default_instance() -> &'static Duration
Source§fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self>
fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self>
Source§fn cached_size(&self) -> u32
fn cached_size(&self) -> u32
compute_size
. Read moreSource§fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<()>
fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<()>
Source§fn write_length_delimited_to(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<()>
fn write_length_delimited_to( &self, os: &mut CodedOutputStream<'_>, ) -> Result<()>
Source§fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<()>
fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<()>
Source§fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<()>
fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<()>
Source§fn parse_from_reader(reader: &mut dyn Read) -> Result<Self>
fn parse_from_reader(reader: &mut dyn Read) -> Result<Self>
Source§fn parse_from_bytes(bytes: &[u8]) -> Result<Self>
fn parse_from_bytes(bytes: &[u8]) -> Result<Self>
Source§fn check_initialized(&self) -> Result<()>
fn check_initialized(&self) -> Result<()>
Source§fn write_length_delimited_to_writer(&self, w: &mut dyn Write) -> Result<()>
fn write_length_delimited_to_writer(&self, w: &mut dyn Write) -> Result<()>
Source§fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>>
fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>>
Source§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn mut_unknown_fields(&mut self) -> &mut UnknownFields
fn mut_unknown_fields(&mut self) -> &mut UnknownFields
Source§impl MessageFull for Duration
impl MessageFull for Duration
Source§fn descriptor() -> MessageDescriptor
fn descriptor() -> MessageDescriptor
Source§fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
Source§impl ProtobufValue for Duration
impl ProtobufValue for Duration
Source§type RuntimeType = RuntimeTypeMessage<Duration>
type RuntimeType = RuntimeTypeMessage<Duration>
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl !Freeze for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<M> MessageDyn for Mwhere
M: MessageFull,
impl<M> MessageDyn for Mwhere
M: MessageFull,
Source§fn descriptor_dyn(&self) -> MessageDescriptor
fn descriptor_dyn(&self) -> MessageDescriptor
Source§fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
Source§fn write_to_with_cached_sizes_dyn(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_to_with_cached_sizes_dyn( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Source§fn compute_size_dyn(&self) -> u64
fn compute_size_dyn(&self) -> u64
Source§fn is_initialized_dyn(&self) -> bool
fn is_initialized_dyn(&self) -> bool
true
for protobuf 3.