pub struct IpcChannelModel {
pub id: u64,
pub capacity: usize,
pub messages: VecDeque<IpcMessage>,
pub sender_count: u32,
pub receiver_count: u32,
pub total_sent: u64,
pub total_received: u64,
/* private fields */
}Expand description
Model of an IPC channel for verification
Fields§
§id: u64Channel identifier
capacity: usizeMaximum number of messages
messages: VecDeque<IpcMessage>Message queue (FIFO)
sender_count: u32Number of senders with access
receiver_count: u32Number of receivers with access
total_sent: u64Total messages ever sent
total_received: u64Total messages ever received
Implementations§
Source§impl IpcChannelModel
impl IpcChannelModel
Sourcepub fn new(id: u64, capacity: usize) -> Self
pub fn new(id: u64, capacity: usize) -> Self
Create a new channel with the given ID and capacity
Sourcepub fn send(
&mut self,
payload: u64,
msg_type: MessageType,
sender: u64,
rights: u32,
) -> Result<u64, IpcModelError>
pub fn send( &mut self, payload: u64, msg_type: MessageType, sender: u64, rights: u32, ) -> Result<u64, IpcModelError>
Send a message on this channel
Sourcepub fn receive(&mut self, rights: u32) -> Result<IpcMessage, IpcModelError>
pub fn receive(&mut self, rights: u32) -> Result<IpcMessage, IpcModelError>
Receive a message from this channel
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Current message count in buffer
Trait Implementations§
Source§impl Clone for IpcChannelModel
impl Clone for IpcChannelModel
Source§fn clone(&self) -> IpcChannelModel
fn clone(&self) -> IpcChannelModel
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IpcChannelModel
impl Debug for IpcChannelModel
Auto Trait Implementations§
impl Freeze for IpcChannelModel
impl RefUnwindSafe for IpcChannelModel
impl Send for IpcChannelModel
impl Sync for IpcChannelModel
impl Unpin for IpcChannelModel
impl UnwindSafe for IpcChannelModel
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)