pub struct ManagedMap<M>where
M: ManagedTypeApi,{ /* private fields */ }
Expand description
A byte buffer managed by an external API.
Implementations§
Source§impl<M> ManagedMap<M>where
M: ManagedTypeApi,
impl<M> ManagedMap<M>where
M: ManagedTypeApi,
pub fn new() -> ManagedMap<M>
Source§impl<M> ManagedMap<M>where
M: ManagedTypeApi,
impl<M> ManagedMap<M>where
M: ManagedTypeApi,
pub fn get(&self, key: &ManagedBuffer<M>) -> ManagedBuffer<M>
pub fn put(&mut self, key: &ManagedBuffer<M>, value: &ManagedBuffer<M>)
pub fn remove(&mut self, key: &ManagedBuffer<M>) -> ManagedBuffer<M>
pub fn contains(&self, key: &ManagedBuffer<M>) -> bool
Trait Implementations§
Source§impl<M> Default for ManagedMap<M>where
M: ManagedTypeApi,
impl<M> Default for ManagedMap<M>where
M: ManagedTypeApi,
Source§fn default() -> ManagedMap<M>
fn default() -> ManagedMap<M>
Returns the “default value” for a type. Read more
Source§impl<M> ManagedType<M> for ManagedMap<M>where
M: ManagedTypeApi,
impl<M> ManagedType<M> for ManagedMap<M>where
M: ManagedTypeApi,
type OwnHandle = <M as HandleTypeInfo>::ManagedMapHandle
fn get_handle(&self) -> <M as HandleTypeInfo>::ManagedMapHandle
Source§unsafe fn forget_into_handle(
self,
) -> <ManagedMap<M> as ManagedType<M>>::OwnHandle
unsafe fn forget_into_handle( self, ) -> <ManagedMap<M> as ManagedType<M>>::OwnHandle
Forgets current object (does not run destructor), but extracts the handle. Read more
Source§fn transmute_from_handle_ref(
handle_ref: &<M as HandleTypeInfo>::ManagedMapHandle,
) -> &ManagedMap<M>
fn transmute_from_handle_ref( handle_ref: &<M as HandleTypeInfo>::ManagedMapHandle, ) -> &ManagedMap<M>
Implement carefully, since the underlying transmutation is an unsafe operation.
For types that wrap a handle to some VM-managed data,
make sure the type only contains the handle (plus ZSTs if necessary).
For types that just wrap another managed type it is easier, call for the wrapped object.
fn transmute_from_handle_ref_mut( handle_ref: &mut <M as HandleTypeInfo>::ManagedMapHandle, ) -> &mut ManagedMap<M>
fn get_raw_handle(&self) -> i32
fn as_ref(&self) -> ManagedRef<'_, M, Self>
Auto Trait Implementations§
impl<M> Freeze for ManagedMap<M>
impl<M> RefUnwindSafe for ManagedMap<M>
impl<M> Send for ManagedMap<M>
impl<M> Sync for ManagedMap<M>
impl<M> Unpin for ManagedMap<M>
impl<M> UnwindSafe for ManagedMap<M>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
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