pub struct TableName(/* private fields */);Expand description
A table name, as the engine holds it and as it is encoded to storage.
Deliberately carries no rendering and no conversion to the public wire type.
Both belong to the language layer, where a name is escaped if it would
otherwise read back as a reserved word — see surrealdb_sql::TableName.
Keeping them off this type is what lets this crate stay a string primitive
rather than depending on the formatting and public-type crates.
It also deliberately does not deref to str. str implements ToSql, so
while it did, writing name.fmt_sql(..) resolved to the unescaped string
rendering instead of failing to compile, and a name that could not be read
back was emitted. Reaching the text requires TableName::as_str, which
makes the choice of escaper explicit at every call site.
That absence is load-bearing rather than incidental, so it is pinned here: re-adding the impl makes this compile, and the test fails.
let name = surrealdb_strand::TableName::from("person");
let _: &str = &name;Implementations§
Trait Implementations§
Source§impl<'de, F> BorrowDecode<'de, F> for TableName
impl<'de, F> BorrowDecode<'de, F> for TableName
fn borrow_decode(r: &mut BorrowReader<'de>) -> Result<TableName, DecodeError>
Source§impl DeserializeRevisioned for TableName
impl DeserializeRevisioned for TableName
impl Eq for TableName
Source§impl IntoPublicTable for TableName
impl IntoPublicTable for TableName
fn into_public_table(self) -> PublicTable
impl LengthPrefixedBytes for TableName
Source§impl Ord for TableName
impl Ord for TableName
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for TableName
impl PartialOrd for TableName
Source§impl Revisioned for TableName
impl Revisioned for TableName
Source§impl SerializeRevisioned for TableName
impl SerializeRevisioned for TableName
Source§impl SkipRevisioned for TableName
impl SkipRevisioned for TableName
fn skip_revisioned<R>(r: &mut R) -> Result<(), Error>where
R: Read,
Source§fn skip_revisioned_slice(r: &mut SliceReader<'_>) -> Result<(), Error>
fn skip_revisioned_slice(r: &mut SliceReader<'_>) -> Result<(), Error>
SliceReader without allocating a buffer for bulk segments. Read moreimpl StructuralPartialEq for TableName
Source§impl WalkRevisioned for TableName
impl WalkRevisioned for TableName
Source§type Walker<'r, R: BorrowedReader + 'r> = LeafWalker<'r, TableName, R>
type Walker<'r, R: BorrowedReader + 'r> = LeafWalker<'r, TableName, R>
walk_revisioned. Read moreSource§fn walk_revisioned<'r, R>(
reader: &'r mut R,
) -> Result<<TableName as WalkRevisioned>::Walker<'r, R>, Error>where
R: BorrowedReader,
fn walk_revisioned<'r, R>(
reader: &'r mut R,
) -> Result<<TableName as WalkRevisioned>::Walker<'r, R>, Error>where
R: BorrowedReader,
Auto Trait Implementations§
impl Freeze for TableName
impl RefUnwindSafe for TableName
impl Send for TableName
impl Sync for TableName
impl Unpin for TableName
impl UnsafeUnpin for TableName
impl UnwindSafe for TableName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.