pub struct FunctionIdentifier { /* private fields */ }Expand description
A SQL function identifier with proper case handling.
Similar to TableIdentifier and ColumnIdentifier, this type separates:
- Canonical form: Lowercase for comparison and lookup
- Display form: Preserves user’s original case for error messages
§Example
use vibesql_ast::FunctionIdentifier;
// User wrote SUBSTR in their query
let func = FunctionIdentifier::new("SUBSTR");
assert_eq!(func.canonical(), "substr"); // Lowercase for comparison
assert_eq!(func.display(), "SUBSTR"); // Original case for errorsImplementations§
Source§impl FunctionIdentifier
impl FunctionIdentifier
Sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Create a new function identifier preserving original case.
The canonical form is lowercased for case-insensitive comparison, while the display form preserves the original case for error messages.
Sourcepub fn matches(&self, name: &str) -> bool
pub fn matches(&self, name: &str) -> bool
Check if this function matches the given name (case-insensitive).
Sourcepub fn to_lowercase(&self) -> String
pub fn to_lowercase(&self) -> String
Return the canonical (lowercase) form as a new String. Provides compatibility with code expecting String methods.
Sourcepub fn to_uppercase(&self) -> String
pub fn to_uppercase(&self) -> String
Return the canonical form uppercased. Provides compatibility with code expecting String methods.
Sourcepub fn eq_ignore_ascii_case(&self, other: &str) -> bool
pub fn eq_ignore_ascii_case(&self, other: &str) -> bool
Case-insensitive comparison with a string slice. Provides compatibility with code expecting String methods.
Trait Implementations§
Source§impl Clone for FunctionIdentifier
impl Clone for FunctionIdentifier
Source§fn clone(&self) -> FunctionIdentifier
fn clone(&self) -> FunctionIdentifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionIdentifier
impl Debug for FunctionIdentifier
Source§impl Display for FunctionIdentifier
impl Display for FunctionIdentifier
Source§impl From<&str> for FunctionIdentifier
impl From<&str> for FunctionIdentifier
Source§impl From<String> for FunctionIdentifier
impl From<String> for FunctionIdentifier
Source§impl Hash for FunctionIdentifier
impl Hash for FunctionIdentifier
Source§impl PartialEq<&str> for FunctionIdentifier
impl PartialEq<&str> for FunctionIdentifier
Source§impl PartialEq<str> for FunctionIdentifier
impl PartialEq<str> for FunctionIdentifier
Source§impl PartialEq for FunctionIdentifier
impl PartialEq for FunctionIdentifier
impl Eq for FunctionIdentifier
Auto Trait Implementations§
impl Freeze for FunctionIdentifier
impl RefUnwindSafe for FunctionIdentifier
impl Send for FunctionIdentifier
impl Sync for FunctionIdentifier
impl Unpin for FunctionIdentifier
impl UnwindSafe for FunctionIdentifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more