Struct Collation

Source
pub struct Collation<'a> {
    pub id: CollationId,
    pub charset: &'a str,
    pub collation: &'a str,
    pub is_default: bool,
    pub padding: PadAttribute,
    pub is_compiled: bool,
    pub sort_len: u8,
    pub max_len: u8,
}
Expand description

MySQL server collation

Fields§

§id: CollationId§charset: &'a str§collation: &'a str§is_default: bool§padding: PadAttribute§is_compiled: bool§sort_len: u8§max_len: u8

Implementations§

Source§

impl Collation<'_>

Constants are generated using the following statement:

SELECT CONCAT(
    0x5c5c5c20, DESCRIPTION, 0x0a,
    'const ', UPPER(COLLATION_NAME), '_COLLATION: Collation<''static> = Collation {',
    'id: CollationId::', UPPER(COLLATION_NAME), ',',
    'charset: "', CHARACTER_SET_NAME, '",',
    'collation: "', COLLATION_NAME, '",',
    'is_default: ', IF(IS_DEFAULT = 'Yes', 'true', 'false'), ',',
    'padding: PadAttribute::', IF(PAD_ATTRIBUTE = 'PAD SPACE', 'PadSpace', 'PadZero'), ',',
    'is_compiled: ', IF(IS_COMPILED = 'Yes', 'true', 'false'), ',',
    'sort_len: ', SORTLEN, ',',
    'max_len: ', MAXLEN,
'};')
FROM INFORMATION_SCHEMA.COLLATIONS
JOIN INFORMATION_SCHEMA.CHARACTER_SETS
USING(CHARACTER_SET_NAME) ORDER BY ID;
Source

pub fn id(&self) -> CollationId

Get the collation ID.

Source

pub fn charset(&self) -> &str

Get the charset.

Source

pub fn collation(&self) -> &str

Get the collation.

Source

pub fn is_default(&self) -> bool

Is the collation default?

Source

pub fn padding(&self) -> PadAttribute

Get the padding attribute.

Source

pub fn is_compiled(&self) -> bool

Is the collation compiled?

Source

pub fn sort_len(&self) -> u8

Get the sort length.

Source

pub fn max_len(&self) -> u8

Get the max length.

Source

pub const fn resolve(id: CollationId) -> Collation<'static>

Resolve collation id into a collation.

Trait Implementations§

Source§

impl<'a> Clone for Collation<'a>

Source§

fn clone(&self) -> Collation<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Collation<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<CollationId> for Collation<'static>

Source§

fn from(value: CollationId) -> Self

Convert a collation ID to a collation.

Source§

impl<'a> Hash for Collation<'a>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> PartialEq for Collation<'a>

Source§

fn eq(&self, other: &Collation<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for Collation<'a>

Source§

impl<'a> StructuralPartialEq for Collation<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Collation<'a>

§

impl<'a> RefUnwindSafe for Collation<'a>

§

impl<'a> Send for Collation<'a>

§

impl<'a> Sync for Collation<'a>

§

impl<'a> Unpin for Collation<'a>

§

impl<'a> UnwindSafe for Collation<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.