#[repr(C)]pub struct GenericPortData<T: PortData> {
pub inner: T,
pub owner_pid: u32,
pub active: bool,
}Expand description
Generic port data wrapper with standard functionality
Fields§
§inner: T§owner_pid: u32§active: boolImplementations§
Trait Implementations§
Source§impl<T: PortData> PlatformData for GenericPortData<T>
impl<T: PortData> PlatformData for GenericPortData<T>
Source§unsafe fn store_in_context(self, ctx: &mut Context)
unsafe fn store_in_context(self, ctx: &mut Context)
Store this data in a context
Source§unsafe fn from_context(ctx: &Context) -> Option<&Self>
unsafe fn from_context(ctx: &Context) -> Option<&Self>
Retrieve this data from a context
Source§unsafe fn from_context_mut(ctx: &mut Context) -> Option<&mut Self>
unsafe fn from_context_mut(ctx: &mut Context) -> Option<&mut Self>
Retrieve this data mutably from a context
Source§unsafe fn take_from_context(ctx: &mut Context) -> Option<Self>
unsafe fn take_from_context(ctx: &mut Context) -> Option<Self>
Take ownership of this data from a context
Source§impl<T: PortData> PortData for GenericPortData<T>
impl<T: PortData> PortData for GenericPortData<T>
Source§fn handle_message(&mut self, message: &Message) -> PortResult
fn handle_message(&mut self, message: &Message) -> PortResult
Called when the port receives a message
Source§fn get_owner_pid(&self) -> Option<u32>
fn get_owner_pid(&self) -> Option<u32>
Get the owner PID for this port (if any)
Source§fn set_owner_pid(&mut self, pid: u32)
fn set_owner_pid(&mut self, pid: u32)
Set the owner PID for this port
Source§fn set_active(&mut self, active: bool)
fn set_active(&mut self, active: bool)
Activate/deactivate the port
Auto Trait Implementations§
impl<T> Freeze for GenericPortData<T>where
T: Freeze,
impl<T> RefUnwindSafe for GenericPortData<T>where
T: RefUnwindSafe,
impl<T> Send for GenericPortData<T>where
T: Send,
impl<T> Sync for GenericPortData<T>where
T: Sync,
impl<T> Unpin for GenericPortData<T>where
T: Unpin,
impl<T> UnwindSafe for GenericPortData<T>where
T: UnwindSafe,
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