Trait PortData

Source
pub trait PortData: PlatformData {
    // Provided methods
    fn handle_message(&mut self, message: &Message) -> PortResult { ... }
    fn get_owner_pid(&self) -> Option<u32> { ... }
    fn set_owner_pid(&mut self, _pid: u32) { ... }
    fn is_active(&self) -> bool { ... }
    fn set_active(&mut self, _active: bool) { ... }
}
Expand description

Trait for port data types to implement cleanup and message handling

Provided Methods§

Source

fn handle_message(&mut self, message: &Message) -> PortResult

Called when the port receives a message

Source

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)

Set the owner PID for this port

Source

fn is_active(&self) -> bool

Check if the port is active

Source

fn set_active(&mut self, _active: bool)

Activate/deactivate the port

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§