pub struct CharsetAnnotation {
pub charset: Option<Charset>,
pub name: Option<Ident>,
pub binary: bool,
pub meta: Meta,
}Expand description
A MySQL character-set type annotation carried by the string-typed DataType
variants — Character, the Text LOB family,
Enum, and Set (each engine-measured to admit it
on mysql:8.4) — the grammar’s opt_charset_with_opt_binary production, part of the
type rather than a column attribute (see the field docs on
DataType::Character).
The canonical render emits the charset selector first, then BINARY
(CHAR CHARACTER SET utf8mb4 BINARY); MySQL’s reversed spellings
(CHAR BINARY CHARACTER SET utf8mb4, CHAR BINARY ASCII) fold onto this one shape,
their exact written order recovered from the node span (an ADR-0011 spelling trade,
mirroring the plural-interval and SIGNED INTEGER folds). The CHARSET synonym
likewise folds to the canonical CHARACTER SET.
Fields§
§charset: Option<Charset>The character-set selector, or None when only the BINARY collation modifier was
written (CHAR BINARY, with no charset). At least one of charset / binary is
always present — an empty annotation is None on the DataType::Character node.
name: Option<Ident>The charset name for Charset::Named (CHARACTER SET <name> / CHARSET <name>);
None for the keyword shortcuts (Charset::Ascii/Charset::Unicode/
Charset::Byte) and the bare-BINARY form. Held on this meta-bearing struct
rather than inside the Charset enum so the tag stays a plain Copy kind. The
name is a MySQL ident_or_text: a bare or backtick-quoted identifier, or a quoted
string (CHARACTER SET 'utf8mb4'), whose spelling round-trips from the Ident’s
quote style.
binary: boolWhether the BINARY binary-collation modifier accompanies the annotation
(CHAR BINARY, CHAR CHARACTER SET x BINARY, CHAR ASCII BINARY).
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl Clone for CharsetAnnotation
impl Clone for CharsetAnnotation
Source§fn clone(&self) -> CharsetAnnotation
fn clone(&self) -> CharsetAnnotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more