pub enum Resource {
Port(Port),
Os(OsResource),
}
Expand description
A resource that can be sent via a port.
Variants§
Port(Port)
Another port.
Os(OsResource)
An OS resource (file descriptor, Windows handle, or socket).
Trait Implementations§
Source§impl From<OwnedHandle> for Resource
impl From<OwnedHandle> for Resource
Source§fn from(port: OwnedHandle) -> Self
fn from(port: OwnedHandle) -> Self
Converts to this type from the input type.
Source§impl From<OwnedSocket> for Resource
impl From<OwnedSocket> for Resource
Source§fn from(port: OwnedSocket) -> Self
fn from(port: OwnedSocket) -> Self
Converts to this type from the input type.
Source§impl MessageDecode<'_, OwnedMessage, Resource> for MessageEncoder
impl MessageDecode<'_, OwnedMessage, Resource> for MessageEncoder
Source§fn read_message(
item: &mut InplaceOption<'_, OwnedMessage>,
reader: MessageReader<'_, '_, Resource>,
) -> Result<()>
fn read_message( item: &mut InplaceOption<'_, OwnedMessage>, reader: MessageReader<'_, '_, Resource>, ) -> Result<()>
Reads a message into
item
.Source§impl MessageEncode<Box<dyn DynSerializeMessage>, Resource> for MessageEncoder
impl MessageEncode<Box<dyn DynSerializeMessage>, Resource> for MessageEncoder
Source§fn write_message(
item: Box<dyn DynSerializeMessage>,
writer: MessageWriter<'_, '_, Resource>,
)
fn write_message( item: Box<dyn DynSerializeMessage>, writer: MessageWriter<'_, '_, Resource>, )
Writes
item
as a message.Source§fn compute_message_size(
item: &mut Box<dyn DynSerializeMessage>,
sizer: MessageSizer<'_>,
)
fn compute_message_size( item: &mut Box<dyn DynSerializeMessage>, sizer: MessageSizer<'_>, )
Computes the size of
item
as a message. Read moreSource§impl MessageEncode<Message<'_>, Resource> for MessageEncoder
impl MessageEncode<Message<'_>, Resource> for MessageEncoder
Source§fn write_message(item: Message<'_>, writer: MessageWriter<'_, '_, Resource>)
fn write_message(item: Message<'_>, writer: MessageWriter<'_, '_, Resource>)
Writes
item
as a message.Source§fn compute_message_size(item: &mut Message<'_>, sizer: MessageSizer<'_>)
fn compute_message_size(item: &mut Message<'_>, sizer: MessageSizer<'_>)
Computes the size of
item
as a message. Read moreSource§impl MessageEncode<OwnedMessage, Resource> for MessageEncoder
impl MessageEncode<OwnedMessage, Resource> for MessageEncoder
Source§fn write_message(item: OwnedMessage, writer: MessageWriter<'_, '_, Resource>)
fn write_message(item: OwnedMessage, writer: MessageWriter<'_, '_, Resource>)
Writes
item
as a message.Source§fn compute_message_size(item: &mut OwnedMessage, sizer: MessageSizer<'_>)
fn compute_message_size(item: &mut OwnedMessage, sizer: MessageSizer<'_>)
Computes the size of
item
as a message. Read moreSource§impl TryFrom<Resource> for OwnedHandle
impl TryFrom<Resource> for OwnedHandle
Source§type Error = ResourceError
type Error = ResourceError
The type returned in the event of a conversion error.
Source§impl TryFrom<Resource> for OwnedSocket
impl TryFrom<Resource> for OwnedSocket
Source§type Error = ResourceError
type Error = ResourceError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for Resource
impl !RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl !UnwindSafe for Resource
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