pub struct RemoteMemoryManager { /* private fields */ }Expand description
A memory manager for another thread.
When accessing memory through this object, we use less efficient codepaths that work across address spaces.
Trait Implementations§
Source§impl MemoryAccessor for RemoteMemoryManager
impl MemoryAccessor for RemoteMemoryManager
Source§fn read_memory<'a>(
&self,
addr: UserAddress,
bytes: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Errno>
fn read_memory<'a>( &self, addr: UserAddress, bytes: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Errno>
Source§fn read_memory_partial_until_null_byte<'a>(
&self,
addr: UserAddress,
bytes: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Errno>
fn read_memory_partial_until_null_byte<'a>( &self, addr: UserAddress, bytes: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Errno>
Reads bytes starting at
addr, continuing until either a null byte is read, bytes.len()
bytes have been read or no more bytes can be read from the target. Read moreSource§fn read_memory_partial<'a>(
&self,
addr: UserAddress,
bytes: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], Errno>
fn read_memory_partial<'a>( &self, addr: UserAddress, bytes: &'a mut [MaybeUninit<u8>], ) -> Result<&'a mut [u8], Errno>
Reads bytes starting at
addr, continuing until either bytes.len() bytes have been read
or no more bytes can be read from the target. Read moreSource§fn write_memory(&self, addr: UserAddress, bytes: &[u8]) -> Result<usize, Errno>
fn write_memory(&self, addr: UserAddress, bytes: &[u8]) -> Result<usize, Errno>
Writes the provided bytes to
addr. Read moreSource§fn write_memory_partial(
&self,
addr: UserAddress,
bytes: &[u8],
) -> Result<usize, Errno>
fn write_memory_partial( &self, addr: UserAddress, bytes: &[u8], ) -> Result<usize, Errno>
Writes bytes starting at
addr, continuing until either bytes.len() bytes have been
written or no more bytes can be written. Read moreSource§impl TaskMemoryAccessor for RemoteMemoryManager
impl TaskMemoryAccessor for RemoteMemoryManager
Source§fn maximum_valid_address(&self) -> Option<UserAddress>
fn maximum_valid_address(&self) -> Option<UserAddress>
Returns the maximum valid address for this memory accessor.
Auto Trait Implementations§
impl Freeze for RemoteMemoryManager
impl !RefUnwindSafe for RemoteMemoryManager
impl Send for RemoteMemoryManager
impl Sync for RemoteMemoryManager
impl Unpin for RemoteMemoryManager
impl !UnwindSafe for RemoteMemoryManager
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]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 moreSource§impl<T> MemoryAccessorExt for Twhere
T: MemoryAccessor,
impl<T> MemoryAccessorExt for Twhere
T: MemoryAccessor,
Source§fn read_memory_to_slice(
&self,
addr: UserAddress,
bytes: &mut [u8],
) -> Result<(), Errno>
fn read_memory_to_slice( &self, addr: UserAddress, bytes: &mut [u8], ) -> Result<(), Errno>
Source§fn read_memory_to_vec(
&self,
addr: UserAddress,
len: usize,
) -> Result<Vec<u8>, Errno>
fn read_memory_to_vec( &self, addr: UserAddress, len: usize, ) -> Result<Vec<u8>, Errno>
Read exactly
len bytes of memory, returning them as a a Vec.Source§fn read_memory_partial_to_vec(
&self,
addr: UserAddress,
max_len: usize,
) -> Result<Vec<u8>, Errno>
fn read_memory_partial_to_vec( &self, addr: UserAddress, max_len: usize, ) -> Result<Vec<u8>, Errno>
Read up to
max_len bytes from addr, returning them as a Vec.Source§fn read_memory_to_array<const N: usize>(
&self,
addr: UserAddress,
) -> Result<[u8; N], Errno>
fn read_memory_to_array<const N: usize>( &self, addr: UserAddress, ) -> Result<[u8; N], Errno>
Read exactly
N bytes from addr, returning them as an array.Source§fn read_buffer(&self, buffer: &UserBuffer) -> Result<Vec<u8>, Errno>
fn read_buffer(&self, buffer: &UserBuffer) -> Result<Vec<u8>, Errno>
Read the contents of
buffer, returning them as a Vec.Source§fn read_object<T: FromBytes>(&self, user: UserRef<T>) -> Result<T, Errno>
fn read_object<T: FromBytes>(&self, user: UserRef<T>) -> Result<T, Errno>
Read an instance of T from
user.fn read_multi_arch_ptr<T64, T32>( &self, user: MultiArchUserRef<MultiArchUserRef<T64, T32>, MultiArchUserRef<T64, T32>>, ) -> Result<MultiArchUserRef<T64, T32>, Errno>
Source§fn read_multi_arch_object<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>(
&self,
user: MappingMultiArchUserRef<T, T64, T32>,
) -> Result<T, Errno>
fn read_multi_arch_object<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>( &self, user: MappingMultiArchUserRef<T, T64, T32>, ) -> Result<T, Errno>
Read an instance of T64 from
user where the object has a different representation in 32
and 64 bits.Source§fn read_multi_arch_objects_to_vec<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>(
&self,
user: MappingMultiArchUserRef<T, T64, T32>,
len: usize,
) -> Result<Vec<T>, Errno>
fn read_multi_arch_objects_to_vec<T, T64: FromBytes + TryInto<T>, T32: FromBytes + TryInto<T>>( &self, user: MappingMultiArchUserRef<T, T64, T32>, len: usize, ) -> Result<Vec<T>, Errno>
Read exactly
len objects from user, returning them as a Vec.Source§fn read_object_partial<T: FromBytes>(
&self,
user: UserRef<T>,
partial_size: usize,
) -> Result<T, Errno>
fn read_object_partial<T: FromBytes>( &self, user: UserRef<T>, partial_size: usize, ) -> Result<T, Errno>
Reads the first
partial bytes of an object, leaving any remainder 0-filled. Read moreSource§fn read_objects<'a, T: FromBytes>(
&self,
user: UserRef<T>,
objects: &'a mut [MaybeUninit<T>],
) -> Result<&'a mut [T], Errno>
fn read_objects<'a, T: FromBytes>( &self, user: UserRef<T>, objects: &'a mut [MaybeUninit<T>], ) -> Result<&'a mut [T], Errno>
Read exactly
objects.len() objects into objects from user.Source§fn read_objects_to_slice<T: FromBytes>(
&self,
user: UserRef<T>,
objects: &mut [T],
) -> Result<(), Errno>
fn read_objects_to_slice<T: FromBytes>( &self, user: UserRef<T>, objects: &mut [T], ) -> Result<(), Errno>
Read exactly
objects.len() objects into objects from user.Source§fn read_objects_to_vec<T: FromBytes>(
&self,
user: UserRef<T>,
len: usize,
) -> Result<Vec<T>, Errno>
fn read_objects_to_vec<T: FromBytes>( &self, user: UserRef<T>, len: usize, ) -> Result<Vec<T>, Errno>
Read exactly
len objects from user, returning them as a Vec.Source§fn read_objects_to_smallvec<T: Clone + FromBytes, const N: usize>(
&self,
user: UserRef<T>,
len: usize,
) -> Result<SmallVec<[T; N]>, Errno>
fn read_objects_to_smallvec<T: Clone + FromBytes, const N: usize>( &self, user: UserRef<T>, len: usize, ) -> Result<SmallVec<[T; N]>, Errno>
Read exactly
len objects from user, returning them as a SmallVec.Source§fn read_objects_to_array<T: Copy + FromBytes, const N: usize>(
&self,
user: UserRef<T>,
) -> Result<[T; N], Errno>
fn read_objects_to_array<T: Copy + FromBytes, const N: usize>( &self, user: UserRef<T>, ) -> Result<[T; N], Errno>
Read exactly
N objects from user, returning them as an array.Source§fn read_iovec<T: Copy + Eq + IntoBytes + FromBytes + Immutable + TryInto<usize>>(
&self,
iovec_addr: IOVecPtr,
iovec_count: UserValue<T>,
) -> Result<UserBuffers, Errno>
fn read_iovec<T: Copy + Eq + IntoBytes + FromBytes + Immutable + TryInto<usize>>( &self, iovec_addr: IOVecPtr, iovec_count: UserValue<T>, ) -> Result<UserBuffers, Errno>
Source§fn read_c_string_to_vec(
&self,
string: UserCString,
max_size: usize,
) -> Result<FsString, Errno>
fn read_c_string_to_vec( &self, string: UserCString, max_size: usize, ) -> Result<FsString, Errno>
Read up to
max_size bytes from string, stopping at the first discovered null byte and
returning the results as a Vec.Source§fn read_path_if_non_null(&self, path: UserCString) -> Result<FsString, Errno>
fn read_path_if_non_null(&self, path: UserCString) -> Result<FsString, Errno>
Source§fn read_nul_delimited_c_string_list(
&self,
start: UserAddress,
len: usize,
) -> Result<Vec<FsString>, Errno>
fn read_nul_delimited_c_string_list( &self, start: UserAddress, len: usize, ) -> Result<Vec<FsString>, Errno>
Read
len bytes from start and parse the region as null-delimited CStrings, for example
how argv is stored. Read moreSource§fn read_c_string<'a>(
&self,
string: UserCString,
buffer: &'a mut [MaybeUninit<u8>],
) -> Result<&'a FsStr, Errno>
fn read_c_string<'a>( &self, string: UserCString, buffer: &'a mut [MaybeUninit<u8>], ) -> Result<&'a FsStr, Errno>
Read up to
buffer.len() bytes from string, stopping at the first discovered null byte
and returning the result as a slice that ends before that null. Read moreSource§fn read_c_string_if_non_null<'a>(
&self,
addr: UserCString,
buffer: &'a mut [MaybeUninit<u8>],
) -> Result<&'a FsStr, Errno>
fn read_c_string_if_non_null<'a>( &self, addr: UserCString, buffer: &'a mut [MaybeUninit<u8>], ) -> Result<&'a FsStr, Errno>
Returns a default initialized string if
addr is null, otherwise
behaves as read_c_string.fn write_object<T: IntoBytes + Immutable>( &self, user: UserRef<T>, object: &T, ) -> Result<usize, Errno>
fn write_objects<T: IntoBytes + Immutable>( &self, user: UserRef<T>, objects: &[T], ) -> Result<usize, Errno>
fn write_multi_arch_ptr<Addr, T64, T32>(
&self,
user: Addr,
object: MultiArchUserRef<T64, T32>,
) -> Result<usize, Errno>where
Addr: Into<UserAddress>,
fn write_multi_arch_object<T, T64: IntoBytes + Immutable + TryFrom<T>, T32: IntoBytes + Immutable + TryFrom<T>>( &self, user: MappingMultiArchUserRef<T, T64, T32>, object: T, ) -> Result<usize, Errno>
Source§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.