pub struct HotplugMonitor { /* private fields */ }Expand description
Implementations§
Source§impl HotplugMonitor
impl HotplugMonitor
Sourcepub fn open(source: Source) -> Result<Self>
pub fn open(source: Source) -> Result<Self>
Start watching.
§Errors
CoreError::Io if udev is unavailable – no /run/udev, or a
container without the netlink socket. A caller that cannot watch can
still poll connectors on a timer; what it loses is knowing when.
Sourcepub fn dispatch(&mut self, out: &mut Vec<HotplugEvent>)
pub fn dispatch(&mut self, out: &mut Vec<HotplugEvent>)
Read every pending uevent, appending the ones that are hotplug.
Everything is drained whether or not it is kept, so the descriptor goes back to unreadable and a caller polling in a loop does not spin.
Trait Implementations§
Source§impl AsFd for HotplugMonitor
impl AsFd for HotplugMonitor
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Auto Trait Implementations§
impl !Send for HotplugMonitor
impl !Sync for HotplugMonitor
impl Freeze for HotplugMonitor
impl RefUnwindSafe for HotplugMonitor
impl Unpin for HotplugMonitor
impl UnsafeUnpin for HotplugMonitor
impl UnwindSafe for HotplugMonitor
Blanket Implementations§
Source§impl<T> AsFilelike for Twhere
T: AsFd,
impl<T> AsFilelike for Twhere
T: AsFd,
Source§fn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
Source§fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
Return a borrowing view of a resource which dereferences to a
&Target. Read moreSource§impl<T> AsSocketlike for Twhere
T: AsFd,
impl<T> AsSocketlike for Twhere
T: AsFd,
Source§fn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
Source§fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
Return a borrowing view of a resource which dereferences to a
&Target. Read moreSource§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