pub struct LogicalFieldId { /* private fields */ }Expand description
A namespaced logical identifier for a column.
This 64-bit struct is designed to prevent ID collisions by partitioning the key space into distinct namespaces, table IDs, and field IDs.
Implementations§
Source§impl LogicalFieldId
impl LogicalFieldId
Sourcepub const fn into_bytes(self) -> [u8; 8]
pub const fn into_bytes(self) -> [u8; 8]
Sourcepub const fn from_bytes(bytes: [u8; 8]) -> Self
pub const fn from_bytes(bytes: [u8; 8]) -> Self
Converts the given bytes directly into the bitfield struct.
Source§impl LogicalFieldId
impl LogicalFieldId
Sourcepub fn field_id(&self) -> <B32 as Specifier>::InOut
pub fn field_id(&self) -> <B32 as Specifier>::InOut
Returns the value of field_id.
The specific field/column within a table (up to ~4.3 billion).
Sourcepub fn field_id_or_err(
&self,
) -> Result<<B32 as Specifier>::InOut, InvalidBitPattern<<B32 as Specifier>::Bytes>>
pub fn field_id_or_err( &self, ) -> Result<<B32 as Specifier>::InOut, InvalidBitPattern<<B32 as Specifier>::Bytes>>
Returns the value of field_id.
§Errors
If the returned value contains an invalid bit pattern for field_id.
The specific field/column within a table (up to ~4.3 billion).
Sourcepub fn with_field_id(self, new_val: <B32 as Specifier>::InOut) -> Self
pub fn with_field_id(self, new_val: <B32 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of field_id set to the given value.
§Panics
If the given value is out of bounds for field_id.
The specific field/column within a table (up to ~4.3 billion).
Sourcepub fn with_field_id_checked(
self,
new_val: <B32 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_field_id_checked( self, new_val: <B32 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of field_id set to the given value.
§Errors
If the given value is out of bounds for field_id.
The specific field/column within a table (up to ~4.3 billion).
Sourcepub fn set_field_id(&mut self, new_val: <B32 as Specifier>::InOut)
pub fn set_field_id(&mut self, new_val: <B32 as Specifier>::InOut)
Sets the value of field_id to the given value.
§Panics
If the given value is out of bounds for field_id.
The specific field/column within a table (up to ~4.3 billion).
Sourcepub fn set_field_id_checked(
&mut self,
new_val: <B32 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_field_id_checked( &mut self, new_val: <B32 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of field_id to the given value.
§Errors
If the given value is out of bounds for field_id.
The specific field/column within a table (up to ~4.3 billion).
Sourcepub fn table_id(&self) -> <B16 as Specifier>::InOut
pub fn table_id(&self) -> <B16 as Specifier>::InOut
Returns the value of table_id.
The table this field belongs to (up to 65,535).
Sourcepub fn table_id_or_err(
&self,
) -> Result<<B16 as Specifier>::InOut, InvalidBitPattern<<B16 as Specifier>::Bytes>>
pub fn table_id_or_err( &self, ) -> Result<<B16 as Specifier>::InOut, InvalidBitPattern<<B16 as Specifier>::Bytes>>
Returns the value of table_id.
§Errors
If the returned value contains an invalid bit pattern for table_id.
The table this field belongs to (up to 65,535).
Sourcepub fn with_table_id(self, new_val: <B16 as Specifier>::InOut) -> Self
pub fn with_table_id(self, new_val: <B16 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of table_id set to the given value.
§Panics
If the given value is out of bounds for table_id.
The table this field belongs to (up to 65,535).
Sourcepub fn with_table_id_checked(
self,
new_val: <B16 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_table_id_checked( self, new_val: <B16 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of table_id set to the given value.
§Errors
If the given value is out of bounds for table_id.
The table this field belongs to (up to 65,535).
Sourcepub fn set_table_id(&mut self, new_val: <B16 as Specifier>::InOut)
pub fn set_table_id(&mut self, new_val: <B16 as Specifier>::InOut)
Sets the value of table_id to the given value.
§Panics
If the given value is out of bounds for table_id.
The table this field belongs to (up to 65,535).
Sourcepub fn set_table_id_checked(
&mut self,
new_val: <B16 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_table_id_checked( &mut self, new_val: <B16 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of table_id to the given value.
§Errors
If the given value is out of bounds for table_id.
The table this field belongs to (up to 65,535).
Sourcepub fn namespace(&self) -> <Namespace as Specifier>::InOut
pub fn namespace(&self) -> <Namespace as Specifier>::InOut
Returns the value of namespace.
The type of data this ID represents (up to 65,536 namespaces).
Sourcepub fn namespace_or_err(
&self,
) -> Result<<Namespace as Specifier>::InOut, InvalidBitPattern<<Namespace as Specifier>::Bytes>>
pub fn namespace_or_err( &self, ) -> Result<<Namespace as Specifier>::InOut, InvalidBitPattern<<Namespace as Specifier>::Bytes>>
Returns the value of namespace.
§Errors
If the returned value contains an invalid bit pattern for namespace.
The type of data this ID represents (up to 65,536 namespaces).
Sourcepub fn with_namespace(self, new_val: <Namespace as Specifier>::InOut) -> Self
pub fn with_namespace(self, new_val: <Namespace as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of namespace set to the given value.
§Panics
If the given value is out of bounds for namespace.
The type of data this ID represents (up to 65,536 namespaces).
Sourcepub fn with_namespace_checked(
self,
new_val: <Namespace as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_namespace_checked( self, new_val: <Namespace as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of namespace set to the given value.
§Errors
If the given value is out of bounds for namespace.
The type of data this ID represents (up to 65,536 namespaces).
Sourcepub fn set_namespace(&mut self, new_val: <Namespace as Specifier>::InOut)
pub fn set_namespace(&mut self, new_val: <Namespace as Specifier>::InOut)
Sets the value of namespace to the given value.
§Panics
If the given value is out of bounds for namespace.
The type of data this ID represents (up to 65,536 namespaces).
Sourcepub fn set_namespace_checked(
&mut self,
new_val: <Namespace as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_namespace_checked( &mut self, new_val: <Namespace as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of namespace to the given value.
§Errors
If the given value is out of bounds for namespace.
The type of data this ID represents (up to 65,536 namespaces).
Source§impl LogicalFieldId
impl LogicalFieldId
Sourcepub fn from_parts(
namespace: Namespace,
table_id: TableId,
field_id: FieldId,
) -> Self
pub fn from_parts( namespace: Namespace, table_id: TableId, field_id: FieldId, ) -> Self
Build a logical field identifier from its namespace, table, and field components.
Sourcepub fn for_user(table_id: TableId, field_id: FieldId) -> Self
pub fn for_user(table_id: TableId, field_id: FieldId) -> Self
Convenience constructor for user data columns.
Sourcepub fn for_user_table_0(field_id: FieldId) -> Self
pub fn for_user_table_0(field_id: FieldId) -> Self
Convenience constructor for user data columns in table 0.
Many tests use table 0 by default; this method avoids repeating the table ID literal.
Trait Implementations§
Source§impl Clone for LogicalFieldId
impl Clone for LogicalFieldId
Source§fn clone(&self) -> LogicalFieldId
fn clone(&self) -> LogicalFieldId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalFieldId
impl Debug for LogicalFieldId
Source§impl Default for LogicalFieldId
impl Default for LogicalFieldId
Source§fn default() -> LogicalFieldId
fn default() -> LogicalFieldId
Source§impl From<LogicalFieldId> for Projection
impl From<LogicalFieldId> for Projection
Source§fn from(logical_field_id: LogicalFieldId) -> Self
fn from(logical_field_id: LogicalFieldId) -> Self
Source§impl From<LogicalFieldId> for u64
impl From<LogicalFieldId> for u64
Source§fn from(__bf_bitfield: LogicalFieldId) -> Self
fn from(__bf_bitfield: LogicalFieldId) -> Self
Source§impl From<u64> for LogicalFieldId
impl From<u64> for LogicalFieldId
Source§impl Hash for LogicalFieldId
impl Hash for LogicalFieldId
Source§impl PartialEq for LogicalFieldId
impl PartialEq for LogicalFieldId
impl Copy for LogicalFieldId
impl Eq for LogicalFieldId
impl StructuralPartialEq for LogicalFieldId
Auto Trait Implementations§
impl Freeze for LogicalFieldId
impl RefUnwindSafe for LogicalFieldId
impl Send for LogicalFieldId
impl Sync for LogicalFieldId
impl Unpin for LogicalFieldId
impl UnwindSafe for LogicalFieldId
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> 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>
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>
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