[−][src]Struct sunrise_libuser::ipc::IPCBuffer
An IPC Buffer represents a section of memory to send to the other side of the pipe. It is usually used for sending big chunks of data that would not send in the comparatively small argument area (which is usually around 200 bytes).
There exists 5 types of IPC Buffers: Send(A), Receive(B), SendReceive(W), Pointer(X) and ReceiveList(C).
Send/Receive/SendReceive buffers work by remapping the memory from the sender's process into the receiver's process. This means that they need to have a page-aligned address and size.
In contrast, Pointer/ReceiveList buffers work by memcpying the sender's Pointer buffer into the receiver's ReceiveList buffer. This allows greater flexibility on the address and size. In general, those are prefered.
Fields
addr: u64
Address to the value
size: u64
Size of the value
ty: IPCBufferType
Buffer type
phantom: PhantomData<&'a ()>
Tie the buffer's lifetime to the value's ! This is very very very important, for the safety of this interface. It ensures that, as long as this IPCBuffer exist, the value it references cannot be dropped.
Implementations
impl<'a> IPCBuffer<'a>
[src]
fn out_buffer<T: SizedIPCBuffer + ?Sized>(data: &T, flags: u8) -> IPCBuffer
[src]
Creates a Type-A IPCBuffer from the given reference.
fn in_buffer<T: SizedIPCBuffer + ?Sized>(data: &mut T, flags: u8) -> IPCBuffer
[src]
Creates a Type-B IPCBuffer from the given reference.
fn in_pointer<T: SizedIPCBuffer + ?Sized>(
data: &mut T,
has_u16_size: bool
) -> IPCBuffer
[src]
data: &mut T,
has_u16_size: bool
) -> IPCBuffer
Creates a Type-C IPCBuffer from the given reference.
If has_u16_size is true, the size of the pointer will be written after the raw data. This is only used when sending client-sized arrays.
fn out_pointer<T: SizedIPCBuffer + ?Sized>(data: &T, counter: u8) -> IPCBuffer
[src]
Creates a Type-X IPCBuffer from the given reference.
The counter defines which type-C buffer this should be copied into.
fn buftype(&self) -> IPCBufferType
[src]
Gets the IPCBufferType of this buffer. The buffer type determines how the buffer is passed to the other process and if it's an argument or a return value.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for IPCBuffer<'a>
impl<'a> Send for IPCBuffer<'a>
impl<'a> Sync for IPCBuffer<'a>
impl<'a> Unpin for IPCBuffer<'a>
impl<'a> UnwindSafe for IPCBuffer<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SizedIPCBuffer for T
[src]
fn size(&Self) -> usize
[src]
fn is_cool(usize, usize) -> bool
[src]
unsafe fn from_raw_parts<'a>(usize, usize) -> &'a T
[src]
unsafe fn from_raw_parts_mut<'a>(usize, usize) -> &'a mut T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,