pub struct DbcLibrary { /* private fields */ }
Expand description
A struct that represents a CANdb file, and provides APIs for interacting with CAN messages and signals.
Implementations§
Source§impl DbcLibrary
impl DbcLibrary
Sourcepub fn new(messages: HashMap<u32, Message>) -> Self
pub fn new(messages: HashMap<u32, Message>) -> Self
Creates a new DbcLibrary
instance given an existing lookup table.
Sourcepub fn from_dbc_file<P>(path: P) -> Result<Self>
pub fn from_dbc_file<P>(path: P) -> Result<Self>
Convenience function for loading an entire DBC file into a returned DbcLibrary
. This
function ignores unparseable lines as well as Entry
variants which don’t apply to
DbcLibrary
(such as Entry::Version
). Fails on io::Error
.
§Example
use canparse::dbc::DbcLibrary;
let lib: DbcLibrary = DbcLibrary::from_dbc_file("./tests/data/sample.dbc").unwrap();
Trait Implementations§
Source§impl Clone for DbcLibrary
impl Clone for DbcLibrary
Source§fn clone(&self) -> DbcLibrary
fn clone(&self) -> DbcLibrary
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DbcLibrary
impl Debug for DbcLibrary
Source§impl Default for DbcLibrary
impl Default for DbcLibrary
Source§fn default() -> DbcLibrary
fn default() -> DbcLibrary
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DbcLibrary
impl RefUnwindSafe for DbcLibrary
impl Send for DbcLibrary
impl Sync for DbcLibrary
impl Unpin for DbcLibrary
impl UnwindSafe for DbcLibrary
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