pub enum KernelObject {
File(Arc<dyn FileObject>),
Pipe(Arc<dyn PipeObject>),
Counter(Arc<dyn CounterObject>),
EventChannel(Arc<EventChannelObject>),
EventSubscription(Arc<EventSubscriptionObject>),
Socket(Arc<dyn SocketObject>),
SharedMemory(Arc<dyn SharedMemoryObject>),
}Expand description
Unified representation of all kernel-managed resources
Note: Debug is not implemented for KernelObject because it contains trait objects that may not implement Debug. Use introspection methods instead.
Variants§
File(Arc<dyn FileObject>)
Pipe(Arc<dyn PipeObject>)
Counter(Arc<dyn CounterObject>)
EventChannel(Arc<EventChannelObject>)
EventSubscription(Arc<EventSubscriptionObject>)
Socket(Arc<dyn SocketObject>)
Implementations§
Source§impl KernelObject
impl KernelObject
Sourcepub fn from_file_object(file_object: Arc<dyn FileObject>) -> Self
pub fn from_file_object(file_object: Arc<dyn FileObject>) -> Self
Create a KernelObject from a FileObject
Sourcepub fn from_pipe_object(pipe_object: Arc<dyn PipeObject>) -> Self
pub fn from_pipe_object(pipe_object: Arc<dyn PipeObject>) -> Self
Create a KernelObject from a PipeObject
Sourcepub fn from_event_channel_object(event_channel: Arc<EventChannelObject>) -> Self
pub fn from_event_channel_object(event_channel: Arc<EventChannelObject>) -> Self
Create a KernelObject from an EventChannelObject
Sourcepub fn from_event_subscription(
event_subscription: Arc<EventSubscriptionObject>,
) -> Self
pub fn from_event_subscription( event_subscription: Arc<EventSubscriptionObject>, ) -> Self
Create a KernelObject from an EventSubscriptionObject
Sourcepub fn from_socket_object(socket: Arc<dyn SocketObject>) -> Self
pub fn from_socket_object(socket: Arc<dyn SocketObject>) -> Self
Create a KernelObject from a SocketObject
Create a KernelObject from a SharedMemoryObject
Sourcepub fn from_counter(counter: Arc<Counter>) -> Self
pub fn from_counter(counter: Arc<Counter>) -> Self
Create a KernelObject from a Counter
Sourcepub fn as_stream_ipc(&self) -> Option<&dyn StreamIpcOps>
pub fn as_stream_ipc(&self) -> Option<&dyn StreamIpcOps>
Try to get StreamIpcOps capability for IPC stream operations
Sourcepub fn as_file(&self) -> Option<&dyn FileObject>
pub fn as_file(&self) -> Option<&dyn FileObject>
Try to get FileObject that provides file-like operations and stream capabilities
Sourcepub fn as_pipe(&self) -> Option<&dyn PipeObject>
pub fn as_pipe(&self) -> Option<&dyn PipeObject>
Try to get PipeObject that provides pipe-specific operations
Sourcepub fn as_socket(&self) -> Option<&dyn SocketObject>
pub fn as_socket(&self) -> Option<&dyn SocketObject>
Try to get SocketObject that provides socket-specific operations
Try to get SharedMemoryObject that provides shared memory operations
Sourcepub fn as_cloneable(&self) -> Option<&dyn CloneOps>
pub fn as_cloneable(&self) -> Option<&dyn CloneOps>
Try to get CloneOps capability
Sourcepub fn as_control(&self) -> Option<&dyn ControlOps>
pub fn as_control(&self) -> Option<&dyn ControlOps>
Try to get ControlOps capability
Sourcepub fn as_memory_mappable(&self) -> Option<&dyn MemoryMappingOps>
pub fn as_memory_mappable(&self) -> Option<&dyn MemoryMappingOps>
Try to get MemoryMappingOps capability
Sourcepub fn as_memory_mappable_weak(&self) -> Option<Weak<dyn MemoryMappingOps>>
pub fn as_memory_mappable_weak(&self) -> Option<Weak<dyn MemoryMappingOps>>
Try to get weak reference to MemoryMappingOps capability
Sourcepub fn as_event_channel(&self) -> Option<&EventChannelObject>
pub fn as_event_channel(&self) -> Option<&EventChannelObject>
Try to get EventChannelObject
Sourcepub fn as_event_subscription(&self) -> Option<&EventSubscriptionObject>
pub fn as_event_subscription(&self) -> Option<&EventSubscriptionObject>
Try to get EventSubscriptionObject
Sourcepub fn as_counter(&self) -> Option<&dyn CounterObject>
pub fn as_counter(&self) -> Option<&dyn CounterObject>
Try to get CounterObject
Sourcepub fn as_selectable(&self) -> Option<&dyn Selectable>
pub fn as_selectable(&self) -> Option<&dyn Selectable>
Try to get Selectable capability for pselect/select readiness
Sourcepub fn arc_clone(&self) -> Self
pub fn arc_clone(&self) -> Self
Clone the KernelObject at the Arc level only (no state changes).
Unlike the Clone trait implementation which may use custom_clone() for
objects like Pipes (incrementing reader/writer counts), this method performs
a simple Arc::clone() that only increments the Arc reference count without
modifying the underlying object state.
Use this when you need a copy of the KernelObject for temporary access without intending to create a new logical file descriptor (dup semantics).
Trait Implementations§
Source§impl Clone for KernelObject
impl Clone for KernelObject
Auto Trait Implementations§
impl Freeze for KernelObject
impl !RefUnwindSafe for KernelObject
impl Send for KernelObject
impl Sync for KernelObject
impl Unpin for KernelObject
impl !UnwindSafe for KernelObject
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
§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)
clone_to_uninit)