Struct MutObject

Source
pub struct MutObject<Base> { /* private fields */ }

Implementations§

Source§

impl<Base> MutObject<Base>

Source

pub unsafe fn from_handle_unchecked(handle: ObjectHandle) -> Self

Source

pub fn from_handle(handle: ObjectHandle) -> Result<Self, TwzError>

Source

pub fn into_handle(self) -> ObjectHandle

Source

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

Source

pub fn map(id: ObjID, flags: MapFlags) -> Result<Self, TwzError>

Source

pub unsafe fn map_unchecked( id: ObjID, flags: MapFlags, ) -> Result<Self, TwzError>

Source

pub fn id(&self) -> ObjID

Source

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

Source

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

Source

pub fn sync(&mut self) -> Result<(), TwzError>

Source

pub fn into_object(self) -> Object<Base>

Source

pub fn as_object(&self) -> Object<Base>

Trait Implementations§

Source§

impl<T> AsRef<ObjectHandle> for MutObject<T>

Source§

fn as_ref(&self) -> &ObjectHandle

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

impl<B> Clone for MutObject<B>

Source§

fn clone(&self) -> Self

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<B> From<MutObject<B>> for Object<B>

Source§

fn from(mut_obj: MutObject<B>) -> Self

Converts to this type from the input type.
Source§

impl<Base> RawObject for MutObject<Base>

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<Base: BaseType> TypedObject for MutObject<Base>

Source§

type Base = Base

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

Source§

impl<Base> Send for MutObject<Base>

Source§

impl<Base> Sync for MutObject<Base>

Auto Trait Implementations§

§

impl<Base> Freeze for MutObject<Base>

§

impl<Base> !ObjSafe for MutObject<Base>

§

impl<Base> RefUnwindSafe for MutObject<Base>
where Base: RefUnwindSafe,

§

impl<Base> StoreCopy for MutObject<Base>
where Base: StoreCopy,

§

impl<Base> Unpin for MutObject<Base>

§

impl<Base> UnwindSafe for MutObject<Base>
where Base: 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> 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.

§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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