Struct TxObject

Source
#[repr(C)]
pub struct TxObject<T = ()> { /* private fields */ }

Implementations§

Source§

impl TxObject<ArenaBase>

Source

pub fn alloc<T>( &mut self, value: T, ) -> Result<OwnedGlobalPtr<T, ArenaAllocator>>

Source

pub fn alloc_inplace<T>( &mut self, f: impl FnOnce(RefMut<'_, MaybeUninit<T>>) -> Result<RefMut<'_, T>>, ) -> Result<OwnedGlobalPtr<T, ArenaAllocator>>

Source

pub fn allocator(&self) -> ArenaAllocator

Source§

impl<T> TxObject<T>

Source

pub fn new(object: Object<T>) -> Result<Self>

Source

pub fn commit(&mut self) -> Result<()>

Source

pub fn abort(&mut self)

Source

pub fn into_object(self) -> Result<Object<T>>

Source

pub fn base_mut(&mut self) -> RefMut<'_, T>

Source

pub unsafe fn cast<U>(self) -> TxObject<U>

Source

pub fn into_unit(self) -> TxObject<()>

Source

pub fn as_mut(&mut self) -> &mut MutObject<T>

Source

pub fn as_ref(&mut self) -> &MutObject<T>

Source

pub fn into_handle(self) -> ObjectHandle

Source§

impl<B> TxObject<MaybeUninit<B>>

Source

pub fn write(self, baseval: B) -> Result<TxObject<B>>

Source

pub unsafe fn assume_init(self) -> TxObject<B>

Source

pub fn static_alloc_inplace<T>( &mut self, f: impl FnOnce(&mut MaybeUninit<T>) -> Result<&mut T>, ) -> Result<GlobalPtr<T>>

Source

pub fn static_alloc<T>(&mut self, value: T) -> Result<GlobalPtr<T>>

Trait Implementations§

Source§

impl<B> AsRef<ObjectHandle> for TxObject<B>

Source§

fn as_ref(&self) -> &ObjectHandle

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<B> AsRef<TxObject> for TxObject<B>

Source§

fn as_ref(&self) -> &TxObject<()>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<B> Drop for TxObject<B>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<B> Into<ObjectHandle> for &TxObject<B>

Source§

fn into(self) -> ObjectHandle

Converts this type into the (usually inferred) input type.
Source§

impl<B> Into<ObjectHandle> for TxObject<B>

Source§

fn into(self) -> ObjectHandle

Converts this type into the (usually inferred) input type.
Source§

impl<T> RawObject for TxObject<T>

Source§

fn handle(&self) -> &ObjectHandle

Get the underlying runtime handle for this object.
Source§

fn id(&self) -> ObjID

Get the object ID.
Source§

fn base_ptr<T>(&self) -> *const T

Get a const pointer to the object base.
Source§

fn base_mut_ptr<T>(&self) -> *mut T

Get a mut pointer to the object base.
Source§

fn meta_ptr(&self) -> *const MetaInfo

Get a const pointer to the object metadata.
Source§

fn meta_mut_ptr(&self) -> *mut MetaInfo

Get a mut pointer to the object metadata.
Source§

fn fote_ptr(&self, idx: usize) -> Option<*const FotEntry>

Get a const pointer to a given FOT entry.
Source§

fn fote_ptr_mut(&self, idx: usize) -> Option<*mut FotEntry>

Get a mut pointer to a given FOT entry.
Source§

fn lea(&self, offset: usize, _len: usize) -> Option<*const u8>

Get a const pointer to given range of the object.
Source§

fn lea_mut(&self, offset: usize, _len: usize) -> Option<*mut u8>

Get a mut pointer to given range of the object.
Source§

fn ptr_local(&self, ptr: *const u8) -> Option<usize>

If the pointer is local to this object, return the offset into the object. Otherwise, return None.
Source§

impl<B: BaseType> TypedObject for TxObject<B>

Source§

type Base = B

The base type of this object.
Source§

fn base_ref(&self) -> Ref<'_, Self::Base>

Returns a resolved reference to the object’s base.
Source§

fn base(&self) -> &Self::Base

Auto Trait Implementations§

§

impl<T> Freeze for TxObject<T>

§

impl<T = ()> !ObjSafe for TxObject<T>

§

impl<T> RefUnwindSafe for TxObject<T>
where T: RefUnwindSafe,

§

impl<T> Send for TxObject<T>

§

impl<T> StoreCopy for TxObject<T>
where T: StoreCopy,

§

impl<T> Sync for TxObject<T>

§

impl<T> Unpin for TxObject<T>

§

impl<T> UnwindSafe for TxObject<T>
where T: RefUnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more