pub struct AbiConnection<T: ?Sized> { /* private fields */ }Expand description
Information about an ABI-connection.
I.e, a caller and callee. The caller is in one particular shared object, the callee in another. Any modifiable state is stored in this object, and the actual callee is stateless (allowing multiple different incoming ‘connections’).
The fields are public, so that they can be easily written by the proc macros. But the user should never interact with them directly, so they are marked as doc(hidden).
Implementations§
Source§impl<T: AbiExportable + ?Sized + 'static> AbiConnection<T>
impl<T: AbiExportable + ?Sized + 'static> AbiConnection<T>
Load the shared library given by ‘filename’, and find a savefile-abi-implementation of the trait ‘T’. Returns an object that implements the
§Safety
The shared library referenced by ‘filename’ must be safely implemented, and must contain an ABI-exported implementation of T, which must be a dyn trait. However, this kind of guarantee is really needed for all execution of any rust code, so we don’t mark this as unsafe. Symbols are unlikely to match by mistake.
Sourcepub fn get_arg_passable_by_ref(&self, method: &str, arg: usize) -> bool
pub fn get_arg_passable_by_ref(&self, method: &str, arg: usize) -> bool
Check if the given argument ‘arg’ in method ‘method’ is memory compatible such that it will be sent as a reference, not copied. This will depend on the memory layout of the code being called into. It will not change during the lifetime of an AbiConnector, but it may change if the target library is recompiled.
Trait Implementations§
Source§impl BufMut for AbiConnection<dyn BufMut>
impl BufMut for AbiConnection<dyn BufMut>
Source§fn remaining_mut(&self) -> usize
fn remaining_mut(&self) -> usize
Source§unsafe fn advance_mut(&mut self, arg_cnt: usize)
unsafe fn advance_mut(&mut self, arg_cnt: usize)
Source§fn chunk_mut(&mut self) -> &mut UninitSlice
fn chunk_mut(&mut self) -> &mut UninitSlice
BufMut::remaining_mut(). Note that this can be shorter than the
whole remainder of the buffer (this allows non-continuous implementation). Read moreSource§fn has_remaining_mut(&self) -> bool
fn has_remaining_mut(&self) -> bool
self for more bytes. Read moreSource§fn put_u16(&mut self, n: u16)
fn put_u16(&mut self, n: u16)
self in big-endian byte order. Read moreSource§fn put_u16_le(&mut self, n: u16)
fn put_u16_le(&mut self, n: u16)
self in little-endian byte order. Read moreSource§fn put_u16_ne(&mut self, n: u16)
fn put_u16_ne(&mut self, n: u16)
self in native-endian byte order. Read moreSource§fn put_i16(&mut self, n: i16)
fn put_i16(&mut self, n: i16)
self in big-endian byte order. Read moreSource§fn put_i16_le(&mut self, n: i16)
fn put_i16_le(&mut self, n: i16)
self in little-endian byte order. Read moreSource§fn put_i16_ne(&mut self, n: i16)
fn put_i16_ne(&mut self, n: i16)
self in native-endian byte order. Read moreSource§fn put_u32(&mut self, n: u32)
fn put_u32(&mut self, n: u32)
self in big-endian byte order. Read moreSource§fn put_u32_le(&mut self, n: u32)
fn put_u32_le(&mut self, n: u32)
self in little-endian byte order. Read moreSource§fn put_u32_ne(&mut self, n: u32)
fn put_u32_ne(&mut self, n: u32)
self in native-endian byte order. Read moreSource§fn put_i32(&mut self, n: i32)
fn put_i32(&mut self, n: i32)
self in big-endian byte order. Read moreSource§fn put_i32_le(&mut self, n: i32)
fn put_i32_le(&mut self, n: i32)
self in little-endian byte order. Read moreSource§fn put_i32_ne(&mut self, n: i32)
fn put_i32_ne(&mut self, n: i32)
self in native-endian byte order. Read moreSource§fn put_u64(&mut self, n: u64)
fn put_u64(&mut self, n: u64)
self in the big-endian byte order. Read moreSource§fn put_u64_le(&mut self, n: u64)
fn put_u64_le(&mut self, n: u64)
self in little-endian byte order. Read moreSource§fn put_u64_ne(&mut self, n: u64)
fn put_u64_ne(&mut self, n: u64)
self in native-endian byte order. Read moreSource§fn put_i64(&mut self, n: i64)
fn put_i64(&mut self, n: i64)
self in the big-endian byte order. Read moreSource§fn put_i64_le(&mut self, n: i64)
fn put_i64_le(&mut self, n: i64)
self in little-endian byte order. Read moreSource§fn put_i64_ne(&mut self, n: i64)
fn put_i64_ne(&mut self, n: i64)
self in native-endian byte order. Read moreSource§fn put_u128(&mut self, n: u128)
fn put_u128(&mut self, n: u128)
self in the big-endian byte order. Read moreSource§fn put_u128_le(&mut self, n: u128)
fn put_u128_le(&mut self, n: u128)
self in little-endian byte order. Read moreSource§fn put_u128_ne(&mut self, n: u128)
fn put_u128_ne(&mut self, n: u128)
self in native-endian byte order. Read moreSource§fn put_i128(&mut self, n: i128)
fn put_i128(&mut self, n: i128)
self in the big-endian byte order. Read moreSource§fn put_i128_le(&mut self, n: i128)
fn put_i128_le(&mut self, n: i128)
self in little-endian byte order. Read moreSource§fn put_i128_ne(&mut self, n: i128)
fn put_i128_ne(&mut self, n: i128)
self in native-endian byte order. Read moreSource§fn put_uint(&mut self, n: u64, nbytes: usize)
fn put_uint(&mut self, n: u64, nbytes: usize)
self in big-endian byte order. Read moreSource§fn put_uint_le(&mut self, n: u64, nbytes: usize)
fn put_uint_le(&mut self, n: u64, nbytes: usize)
self in the little-endian byte order. Read moreSource§fn put_uint_ne(&mut self, n: u64, nbytes: usize)
fn put_uint_ne(&mut self, n: u64, nbytes: usize)
self in the native-endian byte order. Read moreSource§fn put_int_le(&mut self, n: i64, nbytes: usize)
fn put_int_le(&mut self, n: i64, nbytes: usize)
Source§fn put_int_ne(&mut self, n: i64, nbytes: usize)
fn put_int_ne(&mut self, n: i64, nbytes: usize)
Source§fn put_f32(&mut self, n: f32)
fn put_f32(&mut self, n: f32)
self in big-endian byte order. Read moreSource§fn put_f32_le(&mut self, n: f32)
fn put_f32_le(&mut self, n: f32)
self in little-endian byte order. Read moreSource§fn put_f32_ne(&mut self, n: f32)
fn put_f32_ne(&mut self, n: f32)
self in native-endian byte order. Read moreSource§fn put_f64(&mut self, n: f64)
fn put_f64(&mut self, n: f64)
self in big-endian byte order. Read moreSource§fn put_f64_le(&mut self, n: f64)
fn put_f64_le(&mut self, n: f64)
self in little-endian byte order. Read moreSource§fn put_f64_ne(&mut self, n: f64)
fn put_f64_ne(&mut self, n: f64)
self in native-endian byte order. Read more