[][src]Struct odbc_avro::AvroName

pub struct AvroName<'i>(_);

Represents valid Avro name as defined by standard.

Methods

impl<'i> AvroName<'i>[src]

pub fn new(
    name: &'i str,
    normalizer: fn(_: &'i str) -> Result<Cow<'i, str>, NameNormalizationError>
) -> Result<AvroName<'i>, OdbcAvroError>
[src]

Crates AvroName from given string ensuring that it is compatible with Avro specification using normalization function.

pub fn default_normalizer(
    name: &str
) -> Result<Cow<str>, NameNormalizationError>
[src]

Avro name normalizer that makes names compatible as defined by standard by replacing non alpha-numeric characters with underscore.

pub fn lowercase_normalizer(
    name: &str
) -> Result<Cow<str>, NameNormalizationError>
[src]

Avro name normalizer based on default_normalizer but in addition changing characters to lowcase/snakecase form so it plays well with databases.

pub fn as_str(&self) -> &str[src]

Trait Implementations

impl<'i> Debug for AvroName<'i>[src]

impl<'i> Deref for AvroName<'i>[src]

type Target = str

The resulting type after dereferencing.

impl<'_> Display for AvroName<'_>[src]

Auto Trait Implementations

impl<'i> RefUnwindSafe for AvroName<'i>

impl<'i> Send for AvroName<'i>

impl<'i> Sync for AvroName<'i>

impl<'i> Unpin for AvroName<'i>

impl<'i> UnwindSafe for AvroName<'i>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToErrorNoContext<T> for T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<E, C> WrapContext<C> for E

type ContextError = ErrorContext<E, C>