pub struct SchemaDiscoverer<'a> { /* private fields */ }Expand description
Schema discoverer for DBC files
Implementations§
Source§impl<'a> SchemaDiscoverer<'a>
impl<'a> SchemaDiscoverer<'a>
Sourcepub fn new(
header: &'a DbcHeader,
data: &'a [u8],
string_block: &'a StringBlock,
) -> Self
pub fn new( header: &'a DbcHeader, data: &'a [u8], string_block: &'a StringBlock, ) -> Self
Create a new schema discoverer
Sourcepub fn with_max_records(self, max_records: u32) -> Self
pub fn with_max_records(self, max_records: u32) -> Self
Set the maximum number of records to analyze
Sourcepub fn with_validate_strings(self, validate_strings: bool) -> Self
pub fn with_validate_strings(self, validate_strings: bool) -> Self
Set whether to validate string references
Sourcepub fn with_detect_arrays(self, detect_arrays: bool) -> Self
pub fn with_detect_arrays(self, detect_arrays: bool) -> Self
Set whether to detect arrays
Sourcepub fn with_detect_key(self, detect_key: bool) -> Self
pub fn with_detect_key(self, detect_key: bool) -> Self
Set whether to detect the key field
Sourcepub fn discover(&self) -> Result<DiscoveredSchema>
pub fn discover(&self) -> Result<DiscoveredSchema>
Discover the schema of the DBC file
Sourcepub fn generate_schema(&self, name: &str) -> Result<Schema>
pub fn generate_schema(&self, name: &str) -> Result<Schema>
Generate a schema from the discovered fields with automatic field naming
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SchemaDiscoverer<'a>
impl<'a> RefUnwindSafe for SchemaDiscoverer<'a>
impl<'a> Send for SchemaDiscoverer<'a>
impl<'a> Sync for SchemaDiscoverer<'a>
impl<'a> Unpin for SchemaDiscoverer<'a>
impl<'a> UnwindSafe for SchemaDiscoverer<'a>
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