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§
Source§impl Ident
impl Ident
pub fn from_name<S: ToString>(name: S) -> Self
Sourcepub fn from_path<S: ToString>(path: Vec<S>) -> Self
pub fn from_path<S: ToString>(path: Vec<S>) -> Self
Creates a new ident from a non-empty path.
Panics if path is empty.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn pop(self) -> Option<Self>
pub fn pop(self) -> Option<Self>
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 push(&mut self, name: String)
pub fn with_name<S: ToString>(self, name: S) -> Self
pub fn iter(&self) -> impl Iterator<Item = &String>
pub fn starts_with(&self, prefix: &Ident) -> bool
pub fn starts_with_path<S: AsRef<str>>(&self, prefix: &[S]) -> bool
pub fn starts_with_part(&self, prefix: &str) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ident
impl<'de> Deserialize<'de> for Ident
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntoIterator for Ident
impl IntoIterator for Ident
Source§impl JsonSchema for Ident
impl JsonSchema for Ident
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref
keyword. Read moreSource§impl Ord for Ident
impl Ord for Ident
Source§impl PartialOrd for Ident
impl PartialOrd for Ident
impl Eq for Ident
impl StructuralPartialEq for Ident
Auto Trait Implementations§
impl Freeze for Ident
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more