Struct ipc_channel::platform::unix::OsIpcSender
source · pub struct OsIpcSender {
fd: Arc<SharedFileDescriptor>,
nosync_marker: PhantomData<Cell<()>>,
}
Fields§
§fd: Arc<SharedFileDescriptor>
§nosync_marker: PhantomData<Cell<()>>
Implementations§
source§impl OsIpcSender
impl OsIpcSender
fn from_fd(fd: c_int) -> OsIpcSender
sourcefn get_system_sendbuf_size(&self) -> Result<usize, UnixError>
fn get_system_sendbuf_size(&self) -> Result<usize, UnixError>
Maximum size of the kernel buffer used for transfers over this channel.
Note: This is not the actual maximal packet size we are allowed to use… Some of it is reserved by the kernel for bookkeeping.
sourcefn fragment_size(sendbuf_size: usize) -> usize
fn fragment_size(sendbuf_size: usize) -> usize
Calculate maximum payload data size per fragment.
It is the total size of the kernel buffer, minus the part reserved by the kernel.
The sendbuf_size
passed in should usually be the maximum kernel buffer size,
i.e. the value of *SYSTEM_SENDBUF_SIZE –
except after getting ENOBUFS, in which case it needs to be reduced.
sourcefn first_fragment_size(sendbuf_size: usize) -> usize
fn first_fragment_size(sendbuf_size: usize) -> usize
Calculate maximum payload data size of first fragment.
This one is smaller than regular fragments, because it carries the message (size) header.
sourcepub fn get_max_fragment_size() -> usize
pub fn get_max_fragment_size() -> usize
Maximum data size that can be transferred over this channel in a single packet.
This is the size of the main data chunk only – it’s independent of any auxiliary data (FDs) transferred along with it.
A send on this channel won’t block for transfers up to this size under normal circumstances. (It might still block if heavy memory pressure causes ENOBUFS, forcing us to reduce the packet size.)
pub fn send( &self, data: &[u8], channels: Vec<OsIpcChannel>, shared_memory_regions: Vec<OsIpcSharedMemory>, ) -> Result<(), UnixError>
pub fn connect(name: String) -> Result<OsIpcSender, UnixError>
Trait Implementations§
source§impl Clone for OsIpcSender
impl Clone for OsIpcSender
source§fn clone(&self) -> OsIpcSender
fn clone(&self) -> OsIpcSender
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OsIpcSender
impl Debug for OsIpcSender
source§impl PartialEq for OsIpcSender
impl PartialEq for OsIpcSender
impl StructuralPartialEq for OsIpcSender
Auto Trait Implementations§
impl Freeze for OsIpcSender
impl !RefUnwindSafe for OsIpcSender
impl Send for OsIpcSender
impl !Sync for OsIpcSender
impl Unpin for OsIpcSender
impl UnwindSafe for OsIpcSender
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)