Struct ExtentInlineRefFull

Source
#[repr(C, packed(1))]
pub struct ExtentInlineRefFull { pub ref_type: ExtentInlineRefType, pub tail: ExtentInlineRefTail, }
Expand description

This type contains a union of all possible inline extent references. Using this can be helpful when an entire inline reference is read from disk to save trips to the disk but the type of the reference is not known in advance.

For the header-only version, see ExtentInlineRefHeader.

Fields§

§ref_type: ExtentInlineRefType

This should be equal to ExtentInlineRefType::ExtentDataRef.

§tail: ExtentInlineRefTail

This field has different functions depending on the value of ref_type.

Implementations§

Source§

impl ExtentInlineRefFull

Source

pub fn offset(&self) -> Option<u64>

Returns the value of the offset field, if it is valid for the given ref_type.

Source

pub fn extent_data_ref(&self) -> Option<ExtentDataRef>

Returns the extent data reference if the reference type is ExtentInlineRefType::ExtentDataRef.

Source

pub fn shared_data_tail(&self) -> Option<ExtentInlineRefSharedDataTail>

Returns the shared data tail if the reference type is ExtentInlineRefType::SharedDataRef.

Source

pub fn as_tree_block_ref(&self) -> Option<&ExtentInlineTreeBlockRef>

Source

pub fn as_shared_block_ref(&self) -> Option<&ExtentInlineSharedBlockRef>

Source

pub fn as_extent_data_ref(&self) -> Option<&ExtentInlineExtentDataRef>

Source

pub fn as_shared_data_ref(&self) -> Option<&ExtentInlineSharedDataRef>

Trait Implementations§

Source§

impl Clone for ExtentInlineRefFull

Source§

fn clone(&self) -> ExtentInlineRefFull

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl KnownLayout for ExtentInlineRefFull

Source§

type PointerMetadata = <ExtentInlineRefTail as KnownLayout>::PointerMetadata

The type of metadata stored in a pointer to Self. Read more
Source§

impl TryFromBytes for ExtentInlineRefFull

Source§

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
Source§

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
Source§

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
Source§

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
Source§

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
Source§

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
Source§

impl Copy for ExtentInlineRefFull

Source§

impl Immutable for ExtentInlineRefFull

Source§

impl Unaligned for ExtentInlineRefFull

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.