Struct spacetimedb_table::var_len::VarLenRef
source · #[repr(C)]pub struct VarLenRef {
pub length_in_bytes: u16,
pub first_granule: PageOffset,
}
Expand description
Reference to var-len object within a page.
Fields§
§length_in_bytes: u16
The length of the var-len object in bytes.
When self.is_large_blob()
returns true,
this is not the proper length of the object.
Rather, the blob store must be consulted for the true length.
first_granule: PageOffset
The offset to the first granule containing some of the object’s data as well a pointer to the next granule.
Implementations§
source§impl VarLenRef
impl VarLenRef
sourcepub const fn is_large_blob(self) -> bool
pub const fn is_large_blob(self) -> bool
Does this refer to a large blob object
where self.first_granule
is a blob hash?
sourcepub const LARGE_BLOB_SENTINEL: u16 = 65_535u16
pub const LARGE_BLOB_SENTINEL: u16 = 65_535u16
The sentinel for a var-len ref to a large blob.
sourcepub const fn large_blob(first_granule: PageOffset) -> Self
pub const fn large_blob(first_granule: PageOffset) -> Self
Returns a var-len ref for a large blob object.
sourcepub const fn granules_used(&self) -> usize
pub const fn granules_used(&self) -> usize
Returns the number of granules this var-len ref uses in it page.
Trait Implementations§
source§impl Ord for VarLenRef
impl Ord for VarLenRef
source§impl PartialEq for VarLenRef
impl PartialEq for VarLenRef
source§impl PartialOrd for VarLenRef
impl PartialOrd for VarLenRef
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 moreimpl Copy for VarLenRef
impl Eq for VarLenRef
impl StructuralPartialEq for VarLenRef
Auto Trait Implementations§
impl RefUnwindSafe for VarLenRef
impl Send for VarLenRef
impl Sync for VarLenRef
impl Unpin for VarLenRef
impl UnwindSafe for VarLenRef
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