Trait meshtastic::Message

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

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

A re-export of the prost::Message trait, which is required to call the encode and decode methods on protocol buffer messages. 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<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, 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<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, 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<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer.

The entire buffer will be consumed.

source

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

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

source

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, 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<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, 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)

source§

impl Message for String

google.protobuf.StringValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for Vec<u8>

google.protobuf.BytesValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for Bytes

google.protobuf.BytesValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

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

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

Implementors§

source§

impl Message for IpV4Config

source§

impl Message for BluetoothConfig

source§

impl Message for DeviceConfig

source§

impl Message for DisplayConfig

source§

impl Message for LoRaConfig

source§

impl Message for NetworkConfig

source§

impl Message for PositionConfig

source§

impl Message for PowerConfig

source§

impl Message for AmbientLightingConfig

source§

impl Message for AudioConfig

source§

impl Message for CannedMessageConfig

source§

impl Message for DetectionSensorConfig

source§

impl Message for ExternalNotificationConfig

source§

impl Message for MapReportSettings

source§

impl Message for MqttConfig

source§

impl Message for NeighborInfoConfig

source§

impl Message for PaxcounterConfig

source§

impl Message for RangeTestConfig

source§

impl Message for RemoteHardwareConfig

source§

impl Message for SerialConfig

source§

impl Message for StoreForwardConfig

source§

impl Message for TelemetryConfig

source§

impl Message for meshtastic::protobufs::store_and_forward::Heartbeat

source§

impl Message for History

source§

impl Message for Statistics

source§

impl Message for AdminMessage

source§

impl Message for AirQualityMetrics

source§

impl Message for BluetoothConnectionStatus

source§

impl Message for CannedMessageModuleConfig

source§

impl Message for Channel

source§

impl Message for ChannelFile

source§

impl Message for ChannelSet

source§

impl Message for ChannelSettings

source§

impl Message for Compressed

source§

impl Message for Config

source§

impl Message for Contact

source§

impl Message for Data

source§

impl Message for DeviceConnectionStatus

source§

impl Message for DeviceMetadata

source§

impl Message for DeviceMetrics

source§

impl Message for DeviceProfile

source§

impl Message for DeviceState

source§

impl Message for EnvironmentMetrics

source§

impl Message for EthernetConnectionStatus

source§

impl Message for FromRadio

source§

impl Message for GeoChat

source§

impl Message for Group

source§

impl Message for HamParameters

source§

impl Message for HardwareMessage

source§

impl Message for meshtastic::protobufs::Heartbeat

source§

impl Message for LocalConfig

source§

impl Message for LocalModuleConfig

source§

impl Message for LogRecord

source§

impl Message for MapReport

source§

impl Message for MeshPacket

source§

impl Message for ModuleConfig

source§

impl Message for ModuleSettings

source§

impl Message for MqttClientProxyMessage

source§

impl Message for MyNodeInfo

source§

impl Message for Neighbor

source§

impl Message for NeighborInfo

source§

impl Message for NetworkConnectionStatus

source§

impl Message for NodeInfo

source§

impl Message for NodeInfoLite

source§

impl Message for NodeRemoteHardwarePin

source§

impl Message for NodeRemoteHardwarePinsResponse

source§

impl Message for OemStore

source§

impl Message for Paxcount

source§

impl Message for Pli

source§

impl Message for Position

source§

impl Message for PositionLite

source§

impl Message for PowerMetrics

source§

impl Message for QueueStatus

source§

impl Message for RemoteHardwarePin

source§

impl Message for RouteDiscovery

source§

impl Message for Routing

source§

impl Message for RtttlConfig

source§

impl Message for SerialConnectionStatus

source§

impl Message for ServiceEnvelope

source§

impl Message for Status

source§

impl Message for StoreAndForward

source§

impl Message for TakPacket

source§

impl Message for Telemetry

source§

impl Message for ToRadio

source§

impl Message for User

source§

impl Message for Waypoint

source§

impl Message for WifiConnectionStatus

source§

impl Message for XModem