SchemaDiscoverer

Struct SchemaDiscoverer 

Source
pub struct SchemaDiscoverer<'a> { /* private fields */ }
Expand description

Schema discoverer for DBC files

Implementations§

Source§

impl<'a> SchemaDiscoverer<'a>

Source

pub fn new( header: &'a DbcHeader, data: &'a [u8], string_block: &'a StringBlock, ) -> Self

Create a new schema discoverer

Source

pub fn with_max_records(self, max_records: u32) -> Self

Set the maximum number of records to analyze

Source

pub fn with_validate_strings(self, validate_strings: bool) -> Self

Set whether to validate string references

Source

pub fn with_detect_arrays(self, detect_arrays: bool) -> Self

Set whether to detect arrays

Source

pub fn with_detect_key(self, detect_key: bool) -> Self

Set whether to detect the key field

Source

pub fn discover(&self) -> Result<DiscoveredSchema>

Discover the schema of the DBC file

Source

pub fn generate_schema(&self, name: &str) -> Result<Schema>

Generate a schema from the discovered fields with automatic field naming

Trait Implementations§

Source§

impl<'a> Debug for SchemaDiscoverer<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.