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 PartialOrd for VarLenRef
impl PartialOrd for VarLenRef
impl Copy for VarLenRef
impl Eq for VarLenRef
impl StructuralPartialEq for VarLenRef
Auto Trait Implementations§
impl Freeze for VarLenRef
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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