Struct object_lib::object::Object

source ·
pub struct Object {
    pub id: ObjectId,
    pub size: usize,
    backing_storage: Arc<RwLock<FileHandle>>,
    pub backing_allocator: Arc<RwLock<BumpAllocator>>,
}

Fields§

§id: ObjectId§size: usize§backing_storage: Arc<RwLock<FileHandle>>§backing_allocator: Arc<RwLock<BumpAllocator>>

Implementations§

source§

impl Object

source

pub fn new(id: ObjectId, size: usize) -> Option<Self>

source

pub fn is_initialized(&self) -> bool

source

pub fn allocate<T: Persistable>(&self) -> Result<&mut T, AllocationError>

source

pub fn maybe_set_inner_allocator<T>(&self, inner: &mut T)where T: Persistable + PersistentlyAllocatable,

source

pub fn set_inner_allocator<T>(&self, inner: &mut T)where T: Persistable + PersistentlyAllocatable,

source

pub fn read_into<T: Persistable>( &self, ptr: Option<&IPtr> ) -> Result<*mut T, AccessError>

source

pub fn read_into_mut<T: Persistable>( &self, ptr: Option<&IPtr> ) -> Result<&mut T, AccessError>

source

fn get_source_address(&self) -> *const u8

source

pub fn offset_of_raw(&self, field: *const ()) -> u32

source

pub fn iptr_of(&self) -> IPtr

source

pub fn offset_of(&self, field: *const ()) -> IPtr

source

pub fn flush(&self)

source

pub fn flush_range(&self, offset: u64, size: u64)

source

pub fn as_bytes(&self) -> *const [u8]

source

pub fn content_as_bytes(&self) -> *const [u8]

source

pub fn get_backing_storage_path(&self) -> PathBuf

source

pub fn advise(&self)

source

pub fn reload(&self)

source

fn get_header(&self) -> &mut ObjectHeader

source

pub fn bump_version(&self) -> Result<ObjectVersion, ObjectOperationError>

source

pub fn mark_read_access(&self)

source

pub fn get_id(&self) -> ObjectId

source

pub fn get_version(&self) -> ObjectVersion

source

pub fn object_is_cacheable(&self) -> bool

source

pub fn header_size() -> usize

source

pub fn set_mv_enabled(&self, enabled: bool)

source

fn is_mv_enabled(&self) -> bool

source

pub fn object_is_mv_enabled(&self) -> bool

source

pub fn get_mapping_bounds(&self) -> (usize, usize)

source

pub fn copy_as(&self, copy_id: ObjectId)

source

pub fn delete_storage(&self)

source

pub fn trim_to_true_allocation_size(&self)

source

pub fn get_constraint_set(&self) -> &PHashMap<ObjectId, ObjectVersion>

source

pub fn get_version_constraint( &self, foreign_object: ObjectId ) -> Option<ObjectVersion>

source

pub fn upsert_version_constraint( &self, foreign_object: ObjectId, observed_version: ObjectVersion )

source

pub fn is_under_storage_pressure(&self) -> bool

Trait Implementations§

source§

impl From<&Object> for MaterializedObjectVersion

source§

fn from(obj: &Object) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Object

§

impl Send for Object

§

impl Sync for Object

§

impl Unpin for Object

§

impl !UnwindSafe for Object

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V