Message

Trait Message 

Source
pub trait Message: Send + Sync {
    // Required methods
    fn encoded_len(&self) -> usize;
    fn clear(&mut self);

    // Provided methods
    fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
       where Self: Sized { ... }
    fn encode_to_vec(&self) -> Vec<u8> 
       where Self: Sized { ... }
    fn encode_length_delimited(
        &self,
        buf: &mut impl BufMut,
    ) -> Result<(), EncodeError>
       where Self: Sized { ... }
    fn encode_length_delimited_to_vec(&self) -> Vec<u8> 
       where Self: Sized { ... }
    fn decode(buf: impl Buf) -> Result<Self, DecodeError>
       where Self: Default { ... }
    fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
       where Self: Default { ... }
    fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
       where Self: Sized { ... }
    fn merge_length_delimited(
        &mut self,
        buf: impl Buf,
    ) -> Result<(), DecodeError>
       where Self: Sized { ... }
}
Expand description

A Protocol Buffers message.

Required Methods§

Source

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.

Source

fn clear(&mut self)

Clears the message, resetting all fields to their default.

Provided Methods§

Source

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer.

An error will be returned if the buffer does not have sufficient capacity.

Source

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.

Source

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer.

An error will be returned if the buffer does not have sufficient capacity.

Source

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.

Source

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer.

The entire buffer will be consumed.

Source

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.

Source

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self.

The entire buffer will be consumed.

Source

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.

Implementations on Foreign Types§

Source§

impl Message for bool

google.protobuf.BoolValue

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for f32

google.protobuf.FloatValue

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for f64

google.protobuf.DoubleValue

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for i32

google.protobuf.Int32Value

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for i64

google.protobuf.Int64Value

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for u32

google.protobuf.UInt32Value

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for u64

google.protobuf.UInt64Value

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

Source§

impl Message for ()

google.protobuf.Empty

Source§

fn encoded_len(&self) -> usize

Source§

fn clear(&mut self)

§

impl Message for AnyValue

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ArrayValue

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Buckets

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for EntityRef

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Event

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Exemplar

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExponentialHistogram

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExponentialHistogramDataPoint

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportLogsPartialSuccess

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportLogsServiceRequest

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportLogsServiceResponse

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportMetricsPartialSuccess

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportMetricsServiceRequest

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportMetricsServiceResponse

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportTracePartialSuccess

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportTraceServiceRequest

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ExportTraceServiceResponse

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Gauge

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Histogram

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for HistogramDataPoint

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for InstrumentationScope

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for KeyValue

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for KeyValueList

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for LogRecord

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for LogsData

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Metric

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for MetricsData

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for NumberDataPoint

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Resource

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ResourceLogs

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ResourceMetrics

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ResourceSpans

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ScopeLogs

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ScopeMetrics

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ScopeSpans

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Span

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Status

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Sum

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for Summary

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for SummaryDataPoint

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for TracesData

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

§

impl Message for ValueAtQuantile

§

fn encoded_len(&self) -> usize

§

fn clear(&mut self)

Implementors§

Source§

impl Message for Bytes

google.protobuf.BytesValue

Source§

impl Message for String

google.protobuf.StringValue

Source§

impl Message for FileDescriptorSet

§

impl Message for HealthCheckRequest

§

impl Message for HealthCheckResponse

§

impl Message for HealthListRequest

§

impl Message for HealthListResponse

§

impl Message for FieldViolation

§

impl Message for rama::http::grpc::protobuf::types::pb::precondition_failure::Violation

§

impl Message for rama::http::grpc::protobuf::types::pb::quota_failure::Violation

§

impl Message for BadRequest

§

impl Message for DebugInfo

§

impl Message for ErrorInfo

§

impl Message for Help

§

impl Message for LocalizedMessage

§

impl Message for PreconditionFailure

§

impl Message for QuotaFailure

§

impl Message for RequestInfo

§

impl Message for ResourceInfo

§

impl Message for RetryInfo

§

impl Message for rama::http::grpc::protobuf::types::Status

Source§

impl Message for Vec<u8>

google.protobuf.BytesValue

Source§

impl Message for File

Source§

impl Message for CodeGeneratorRequest

Source§

impl Message for CodeGeneratorResponse

Source§

impl Message for Version

Source§

impl Message for ExtensionRange

Source§

impl Message for ReservedRange

Source§

impl Message for EnumReservedRange

Source§

impl Message for Annotation

Source§

impl Message for Location

Source§

impl Message for Any

Source§

impl Message for Api

Source§

impl Message for DescriptorProto

Source§

impl Message for Duration

Source§

impl Message for Enum

Source§

impl Message for EnumDescriptorProto

Source§

impl Message for EnumOptions

Source§

impl Message for EnumValue

Source§

impl Message for EnumValueDescriptorProto

Source§

impl Message for EnumValueOptions

Source§

impl Message for ExtensionRangeOptions

Source§

impl Message for Field

Source§

impl Message for FieldDescriptorProto

Source§

impl Message for FieldMask

Source§

impl Message for FieldOptions

Source§

impl Message for FileDescriptorProto

Source§

impl Message for FileOptions

Source§

impl Message for GeneratedCodeInfo

Source§

impl Message for ListValue

Source§

impl Message for MessageOptions

Source§

impl Message for Method

Source§

impl Message for MethodDescriptorProto

Source§

impl Message for MethodOptions

Source§

impl Message for Mixin

Source§

impl Message for OneofDescriptorProto

Source§

impl Message for OneofOptions

Source§

impl Message for Option

Source§

impl Message for ServiceDescriptorProto

Source§

impl Message for ServiceOptions

Source§

impl Message for SourceCodeInfo

Source§

impl Message for SourceContext

Source§

impl Message for Struct

Source§

impl Message for Timestamp

Source§

impl Message for Type

Source§

impl Message for UninterpretedOption

Source§

impl Message for Value

Source§

impl Message for NamePart

Source§

impl<M> Message for Box<M>
where M: Message,