Skip to main content

Name

Struct Name 

Source
pub struct Name { /* private fields */ }
Expand description

identifier or string or CROSS or FULL or INNER or LEFT or NATURAL or OUTER or RIGHT.

Two Names are equal if they refer to the same identifier, regardless of quoting style (e.g. ABORT and "ABORT" are the same identifier).

Implementations§

Source§

impl Name

Source

pub fn exact(s: String) -> Self

Create name which will have exactly the value of given string (e.g. if s = “"str"” - the name value will contain quotes and translation to SQL will give us “”“str”“”)

Source

pub fn from_bytes(s: &[u8]) -> Self

Parse name from the bytes (e.g. handle quoting and handle escaped quotes)

Source

pub const fn empty() -> Self

Source

pub fn from_string(s: impl AsRef<str>) -> Self

Parse name from the string (e.g. handle quoting and handle escaped quotes)

Source

pub fn as_str(&self) -> &str

Return string value of the name

Source

pub fn as_literal(&self) -> String

Convert value to the string literal (e.g. single-quoted string with escaped single quotes)

Source

pub fn as_ident(&self) -> String

Convert value to the name string (e.g. double-quoted string with escaped double quotes)

Source

pub fn quoted_with(&self, quote: char) -> bool

Checks if a name represents a quoted string that should get fallback behavior Need to detect legacy conversion of double quoted keywords to string literals (see https://sqlite.org/lang_keywords.html)

Also, used to detect string literals in PRAGMA cases

Source

pub const fn quoted(&self) -> bool

Trait Implementations§

Source§

impl Clone for Name

Source§

fn clone(&self) -> Name

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Name

Source§

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

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

impl Display for Name

Source§

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

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

impl Eq for Name

Source§

impl Hash for Name

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 PartialEq for Name

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl ToTokens for Name

Source§

fn to_tokens<S: TokenStream + ?Sized, C: ToSqlContext>( &self, s: &mut S, _: &C, ) -> Result<(), S::Error>

Send token(s) to the specified stream with context
Source§

fn displayer<'a, 'b, C: ToSqlContext>( &'b self, ctx: &'a C, ) -> SqlDisplayer<'a, 'b, C, Self>
where Self: Sized,

Auto Trait Implementations§

§

impl Freeze for Name

§

impl RefUnwindSafe for Name

§

impl Send for Name

§

impl Sync for Name

§

impl Unpin for Name

§

impl UnsafeUnpin for Name

§

impl UnwindSafe for Name

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.