pub trait ToPacketFieldId {
// Required method
fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>, Error>;
}
Expand description
A trait to get a PacketFieldId
for a given value.
Required Methods§
Sourcefn to_packet_field_id(&self) -> Result<PacketFieldId<'_>, Error>
fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>, Error>
Get the PacketFieldId
for a given value.
Implementations on Foreign Types§
Source§impl ToPacketFieldId for str
impl ToPacketFieldId for str
Source§fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>, Error>
fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>, Error>
Parse the string into a packet field ID tuple.
§Examples
use resol_vbus::{PacketId, PacketFieldId, ToPacketFieldId};
assert_eq!(PacketFieldId(PacketId(0x11, 0x1213, 0x1415, 0x1718), "012_4_0"), "11_1213_1415_10_1718_012_4_0".to_packet_field_id().unwrap());