pub struct CollectionName(/* private fields */);Expand description
A validated collection name.
Collection names identify different vector collections. Names must be non-empty and contain only alphanumeric characters, underscores, and hyphens.
§Example
use manifoldb_vector::types::CollectionName;
let name = CollectionName::new("documents").unwrap();
assert_eq!(name.as_str(), "documents");Implementations§
Source§impl CollectionName
impl CollectionName
Sourcepub fn new(name: impl Into<String>) -> Result<Self, VectorError>
pub fn new(name: impl Into<String>) -> Result<Self, VectorError>
Create a new collection name.
§Errors
Returns an error if the name is empty or contains invalid characters.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consume the name and return the underlying string.
Trait Implementations§
Source§impl AsRef<str> for CollectionName
impl AsRef<str> for CollectionName
Source§impl Clone for CollectionName
impl Clone for CollectionName
Source§fn clone(&self) -> CollectionName
fn clone(&self) -> CollectionName
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 CollectionName
impl Debug for CollectionName
Source§impl<'de> Deserialize<'de> for CollectionName
impl<'de> Deserialize<'de> for CollectionName
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 Display for CollectionName
impl Display for CollectionName
Source§impl Hash for CollectionName
impl Hash for CollectionName
Source§impl PartialEq for CollectionName
impl PartialEq for CollectionName
Source§impl Serialize for CollectionName
impl Serialize for CollectionName
impl Eq for CollectionName
impl StructuralPartialEq for CollectionName
Auto Trait Implementations§
impl Freeze for CollectionName
impl RefUnwindSafe for CollectionName
impl Send for CollectionName
impl Sync for CollectionName
impl Unpin for CollectionName
impl UnwindSafe for CollectionName
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