pub struct ClassInfo {
pub classes: Vec<ClassEntry>,
pub bits: usize,
/* private fields */
}Expand description
Parsed class info from DEM_ClassInfo. Maps class IDs to network names.
Fields§
§classes: Vec<ClassEntry>§bits: usizeNumber of bits needed to encode a class_id.
Implementations§
Source§impl ClassInfo
impl ClassInfo
Sourcepub fn parse(cmd: CDemoClassInfo) -> Self
pub fn parse(cmd: CDemoClassInfo) -> Self
Parse a CDemoClassInfo protobuf message into a ClassInfo.
Sourcepub fn by_id(&self, class_id: i32) -> Option<&ClassEntry>
pub fn by_id(&self, class_id: i32) -> Option<&ClassEntry>
Look up a class entry by its numeric ID. O(1).
Sourcepub fn name_by_id(&self, class_id: i32) -> Option<&str>
pub fn name_by_id(&self, class_id: i32) -> Option<&str>
Shorthand to get the network name for a class ID.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClassInfo
impl RefUnwindSafe for ClassInfo
impl Send for ClassInfo
impl Sync for ClassInfo
impl Unpin for ClassInfo
impl UnsafeUnpin for ClassInfo
impl UnwindSafe for ClassInfo
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