Skip to content

Commit 5aae09c

Browse files
authored
A bit more documentation fixes (#347)
* Fix the description of TimeoutFlags::ETIME_SUCCESS (#342) * fix opcode::Timeout docs `TimeoutFlags::TIMEOUT` does not exists, pull request that added it probably meant `TimeoutFlags::MULTISHOT`, but it's not in scope either so fix for that too * document submit_with_args a bit more * fix docs for TimeoutFlags Constants referred by docs are available directly, without `types::` prefix
1 parent 7b3fc6b commit 5aae09c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/opcode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ opcode! {
543543
timespec: { *const types::Timespec },
544544
;;
545545
/// `count` may contain a completion event count.
546-
/// If [`TimeoutFlags::TIMEOUT`] is set in `flags`, this is the number of repeats. A value of 0 means the timeout is
547-
/// indefinite and can only be stopped by a removal request.
546+
/// If [`TimeoutFlags::MULTISHOT`](types::TimeoutFlags::MULTISHOT) is set in `flags`, this is the number of repeats.
547+
/// A value of 0 means the timeout is indefinite and can only be stopped by a removal request.
548548
count: u32 = 0,
549549

550550
flags: types::TimeoutFlags = types::TimeoutFlags::empty()

src/submit.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ impl<'a> Submitter<'a> {
142142
unsafe { self.enter::<libc::sigset_t>(len as _, want as _, flags, None) }
143143
}
144144

145+
/// Submit all queued submission queue events to the kernel and wait for at least `want`
146+
/// completion events to complete with additional options
147+
///
148+
/// You can specify a set of signals to mask and a timeout for operation, see
149+
/// [`SubmitArgs`](types::SubmitArgs) for more details
145150
pub fn submit_with_args(
146151
&self,
147152
want: usize,

src/types.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ bitflags! {
8080
/// Options for [`Timeout`](super::Timeout).
8181
///
8282
/// The default behavior is to treat the timespec as a relative time interval. `flags` may
83-
/// contain [`types::TimeoutFlags::ABS`] to indicate the timespec represents an absolute
83+
/// contain [`TimeoutFlags::ABS`] to indicate the timespec represents an absolute
8484
/// time. When an absolute time is being specified, the kernel will use its monotonic clock
8585
/// unless one of the following flags is set (they may not both be set):
86-
/// [`types::TimeoutFlags::BOOTTIME`] or [`types::TimeoutFlags::REALTIME`].
86+
/// [`TimeoutFlags::BOOTTIME`] or [`TimeoutFlags::REALTIME`].
8787
///
8888
/// The default behavior when the timeout expires is to sever dependent links, as a failed
89-
/// request normally would. To keep the links untouched include [`types::TimeoutFlags::ETIME_SUCCESS`].
89+
/// request normally would. To keep the links untouched include [`TimeoutFlags::ETIME_SUCCESS`].
9090
/// CQE will still contain -libc::ETIME in the res field
9191
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
9292
pub struct TimeoutFlags: u32 {
@@ -253,6 +253,9 @@ impl<'prev, 'now> SubmitArgs<'prev, 'now> {
253253
}
254254

255255
#[inline]
256+
/// Signals to mask during waiting for the result
257+
///
258+
/// Masked signals will be restored after submit operation returns
256259
pub fn sigmask<'new>(mut self, sigmask: &'new libc::sigset_t) -> SubmitArgs<'now, 'new> {
257260
self.args.sigmask = cast_ptr(sigmask) as _;
258261
self.args.sigmask_sz = std::mem::size_of::<libc::sigset_t>() as _;
@@ -265,6 +268,7 @@ impl<'prev, 'now> SubmitArgs<'prev, 'now> {
265268
}
266269

267270
#[inline]
271+
/// Timeout for submit operation
268272
pub fn timespec<'new>(mut self, timespec: &'new Timespec) -> SubmitArgs<'now, 'new> {
269273
self.args.ts = cast_ptr(timespec) as _;
270274

0 commit comments

Comments
 (0)