Struct Metric
pub struct Metric {
pub label: Vec<LabelPair>,
pub gauge: MessageField<Gauge>,
pub counter: MessageField<Counter>,
pub summary: MessageField<Summary>,
pub untyped: MessageField<Untyped>,
pub histogram: MessageField<Histogram>,
pub timestamp_ms: Option<i64>,
pub special_fields: SpecialFields,
}Fields§
§label: Vec<LabelPair>§gauge: MessageField<Gauge>§counter: MessageField<Counter>§summary: MessageField<Summary>§untyped: MessageField<Untyped>§histogram: MessageField<Histogram>§timestamp_ms: Option<i64>§special_fields: SpecialFieldsImplementations§
§impl Metric
impl Metric
pub fn new() -> Metric
pub fn timestamp_ms(&self) -> i64
pub fn clear_timestamp_ms(&mut self)
pub fn has_timestamp_ms(&self) -> bool
pub fn set_timestamp_ms(&mut self, v: i64)
§impl Metric
impl Metric
pub fn from_label(label: Vec<LabelPair>) -> Metric
pub fn from_label(label: Vec<LabelPair>) -> Metric
Creates a new metric with the specified label pairs.
pub fn from_gauge(gauge: Gauge) -> Metric
pub fn from_gauge(gauge: Gauge) -> Metric
Creates a new metric with the specified gauge value.
pub fn get_timestamp_ms(&self) -> i64
👎Deprecated since 0.14.0: Please use .timestamp_ms() instead
pub fn get_timestamp_ms(&self) -> i64
Please use .timestamp_ms() instead
Returns the timestamp of this metric.
pub fn get_summary(&self) -> &MessageField<Summary>
pub fn get_summary(&self) -> &MessageField<Summary>
Returns the summary of this metric.
pub fn set_summary(&mut self, summary: Summary)
pub fn set_summary(&mut self, summary: Summary)
Sets the summary of this metric to the specified summary.
pub fn get_counter(&self) -> &MessageField<Counter>
pub fn get_counter(&self) -> &MessageField<Counter>
Returns the value of the counter for this metric.
pub fn set_counter(&mut self, counter: Counter)
pub fn set_counter(&mut self, counter: Counter)
Sets the counter of this metric to the specified counter.
pub fn take_label(&mut self) -> Vec<LabelPair>
pub fn take_label(&mut self) -> Vec<LabelPair>
Returns all label pairs associated with ownership.
pub fn get_histogram(&self) -> &MessageField<Histogram>
pub fn get_histogram(&self) -> &MessageField<Histogram>
Returns the histogram of this metric.
pub fn set_histogram(&mut self, histogram: Histogram)
pub fn set_histogram(&mut self, histogram: Histogram)
Sets the histogram of this metric to the specified histogram.
Trait Implementations§
§impl Message for Metric
impl Message for Metric
§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
True iff all required fields are initialized.
Always returns
true for protobuf 3.§fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
Update this message object with fields read from given stream.
§fn compute_size(&self) -> u64
fn compute_size(&self) -> u64
Compute and cache size of this message and all nested messages. Read more
§fn write_to_with_cached_sizes(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_to_with_cached_sizes( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Write message to the stream. Read more
§fn special_fields(&self) -> &SpecialFields
fn special_fields(&self) -> &SpecialFields
Special fields (unknown fields and cached size).
§fn mut_special_fields(&mut self) -> &mut SpecialFields
fn mut_special_fields(&mut self) -> &mut SpecialFields
Special fields (unknown fields and cached size).
§fn default_instance() -> &'static Metric
fn default_instance() -> &'static Metric
Return a pointer to default immutable message with static lifetime. Read more
§fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self, Error>
fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self, Error>
Parse message from stream.
§fn cached_size(&self) -> u32
fn cached_size(&self) -> u32
Get size previously computed by
compute_size. Read more§fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<(), Error>
fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<(), Error>
Write the message to the stream. Read more
§fn write_length_delimited_to(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_length_delimited_to( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Write the message to the stream prepending the message with message length
encoded as varint.
§fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<(), Error>
fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<(), Error>
Write the message to the vec, prepend the message with message length
encoded as varint.
§fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
Update this message object with fields read from given stream.
§fn parse_from_reader(reader: &mut dyn Read) -> Result<Self, Error>
fn parse_from_reader(reader: &mut dyn Read) -> Result<Self, Error>
Parse message from reader.
Parse stops on EOF or when error encountered.
§fn parse_from_bytes(bytes: &[u8]) -> Result<Self, Error>
fn parse_from_bytes(bytes: &[u8]) -> Result<Self, Error>
Parse message from byte array.
§fn parse_from_tokio_bytes(bytes: &Bytes) -> Result<Self, Error>
fn parse_from_tokio_bytes(bytes: &Bytes) -> Result<Self, Error>
Parse message from
Bytes object.
Resulting message may share references to the passed bytes object.§fn check_initialized(&self) -> Result<(), Error>
fn check_initialized(&self) -> Result<(), Error>
Check if all required fields of this object are initialized.
§fn write_to_writer(&self, w: &mut dyn Write) -> Result<(), Error>
fn write_to_writer(&self, w: &mut dyn Write) -> Result<(), Error>
Write the message to the writer.
§fn write_length_delimited_to_writer(
&self,
w: &mut dyn Write,
) -> Result<(), Error>
fn write_length_delimited_to_writer( &self, w: &mut dyn Write, ) -> Result<(), Error>
Write the message to the writer, prepend the message with message length
encoded as varint.
§fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>, Error>
fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>, Error>
Write the message to the bytes vec, prepend the message with message length
encoded as varint.
§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Get a reference to unknown fields.
§fn mut_unknown_fields(&mut self) -> &mut UnknownFields
fn mut_unknown_fields(&mut self) -> &mut UnknownFields
Get a mutable reference to unknown fields.
§impl MessageFull for Metric
impl MessageFull for Metric
§fn descriptor() -> MessageDescriptor
fn descriptor() -> MessageDescriptor
Get message descriptor for message type. Read more
§fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
Reflective equality. Read more
§impl ProtobufValue for Metric
impl ProtobufValue for Metric
§type RuntimeType = RuntimeTypeMessage<Metric>
type RuntimeType = RuntimeTypeMessage<Metric>
Actual implementation of type properties.
impl StructuralPartialEq for Metric
Auto Trait Implementations§
impl !Freeze for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnsafeUnpin for Metric
impl UnwindSafe for Metric
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<M> MessageDyn for Mwhere
M: MessageFull,
impl<M> MessageDyn for Mwhere
M: MessageFull,
§fn descriptor_dyn(&self) -> MessageDescriptor
fn descriptor_dyn(&self) -> MessageDescriptor
Message descriptor for this message, used for reflection.
§fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
Update this message fields with contents of given stream.
§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>
Write the message.
§fn compute_size_dyn(&self) -> u64
fn compute_size_dyn(&self) -> u64
Compute (and cache) the message size.
§fn is_initialized_dyn(&self) -> bool
fn is_initialized_dyn(&self) -> bool
True iff all required fields are initialized.
Always returns
true for protobuf 3.§fn special_fields_dyn(&self) -> &SpecialFields
fn special_fields_dyn(&self) -> &SpecialFields
Get a reference to special fields.
§fn mut_special_fields_dyn(&mut self) -> &mut SpecialFields
fn mut_special_fields_dyn(&mut self) -> &mut SpecialFields
Get a mutable reference to special fields.