Struct prql_compiler::ir::pl::Ident
pub struct Ident {
pub path: Vec<String>,
pub name: String,
}
Expand description
A name. Generally columns, tables, functions, variables. This is glorified way of writing a “vec with at least one element”.
Fields§
§path: Vec<String>
§name: String
Implementations§
§impl Ident
impl Ident
pub fn from_name<S>(name: S) -> Identwhere
S: ToString,
pub fn from_path<S>(path: Vec<S>) -> Identwhere
S: ToString,
pub fn from_path<S>(path: Vec<S>) -> Identwhere
S: ToString,
Creates a new ident from a non-empty path.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn pop(self) -> Option<Ident>
pub fn pop(self) -> Option<Ident>
Remove last part of the ident. Result will generally refer to the parent of this ident.
pub fn pop_front(self) -> (String, Option<Ident>)
pub fn prepend(self, parts: Vec<String>) -> Ident
pub fn with_name<S>(self, name: S) -> Identwhere
S: ToString,
pub fn iter(&self) -> impl Iterator<Item = &String>
pub fn starts_with(&self, prefix: &Ident) -> bool
pub fn starts_with_path<S>(&self, prefix: &[S]) -> bool
pub fn starts_with_part(&self, prefix: &str) -> bool
Trait Implementations§
§impl<'de> Deserialize<'de> for Ident
impl<'de> Deserialize<'de> for Ident
§fn deserialize<D>(
deserializer: D
) -> Result<Ident, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Ident, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl IntoIterator for Ident
impl IntoIterator for Ident
§impl Ord for Ident
impl Ord for Ident
§impl PartialOrd for Ident
impl PartialOrd for Ident
§fn partial_cmp(&self, other: &Ident) -> Option<Ordering>
fn partial_cmp(&self, other: &Ident) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl Serialize for Ident
impl Serialize for Ident
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Ident
impl StructuralPartialEq for Ident
Auto Trait Implementations§
impl RefUnwindSafe for Ident
impl Send for Ident
impl Sync for Ident
impl Unpin for Ident
impl UnwindSafe for Ident
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more