Trait resol_vbus::ToPacketFieldId
source · pub trait ToPacketFieldId {
fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>>;
}
Expand description
A trait to get a PacketFieldId
for a given value.
Required Methods§
sourcefn to_packet_field_id(&self) -> Result<PacketFieldId<'_>>
fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>>
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<'_>>
fn to_packet_field_id(&self) -> Result<PacketFieldId<'_>>
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());