Skip to content

Commit

Permalink
Fix documentation errors in nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaublitz committed Sep 9, 2023
1 parent ff83149 commit c01b3a4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
12 changes: 6 additions & 6 deletions src/err.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! This is the module that contains the error types used in `neli`
//!
//! There are five main types:
//! * [`Nlmsgerr`][crate::err::Nlmsgerr] - an application error
//! * [`Nlmsgerr`] - an application error
//! returned from netlink as a packet.
//! * [`RouterError`][crate::err::RouterError] - errors returned by
//! * [`RouterError`] - errors returned by
//! [`NlRouter`][crate::router::synchronous::NlRouter].
//! * [`SocketError`][crate::err::SocketError] - errors returned by
//! * [`SocketError`] - errors returned by
//! [`NlSocketHandle`][crate::socket::synchronous::NlSocketHandle].
//! * [`DeError`] - error while deserializing
//! * [`SerError`] - error while serializing
Expand Down Expand Up @@ -533,7 +533,7 @@ impl From<MsgError> for SocketError {

impl SocketError {
/// Create new error from a data type implementing
/// [`Display`][std::fmt::Display]
/// [`Display`]
pub fn new<D>(s: D) -> Self
where
D: Display,
Expand Down Expand Up @@ -645,13 +645,13 @@ pub enum DeError {
Io(ErrorKind),
/// String UTF conversion error.
Utf8(Utf8),
/// Invalid input parameter for [`FromBytesWithInput`][crate::FromBytesWithInput].
/// Invalid input parameter for [`FromBytesWithInput`].
InvalidInput(usize),
}

impl DeError {
/// Create new error from a type implementing
/// [`Display`][std::fmt::Display]
/// [`Display`]
pub fn new<D>(s: D) -> Self
where
D: Display,
Expand Down
9 changes: 4 additions & 5 deletions src/genl.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
//! This module contains generic netlink parsing data structures.
//! This is all handled by the [`Genlmsghdr`][crate::genl::Genlmsghdr]
//! This is all handled by the [`Genlmsghdr`]
//! header struct which contains all of the information needed for
//! the generic netlink layer.
//!
//! # Design decisions
//!
//! The generic netlink `attrs` field has been changed to a
//! [`GenlBuffer`][crate::types::GenlBuffer] of
//! [`Nlattr`][crate::genl::Nlattr]s instead of the
//! [`GenlBuffer`] of [`Nlattr`]s instead of the
//! original [`Vec<u8>`][Vec] to allow simpler parsing at the top
//! level when one [`Nlattr`][crate::genl::Nlattr] structure is not
//! level when one [`Nlattr`] structure is not
//! nested within another, a use case that is instead handled using
//! [`AttrHandle`][crate::attr::AttrHandle].
//! [`AttrHandle`].

use std::io::Cursor;

Expand Down
2 changes: 1 addition & 1 deletion src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ where
}

/// Optional method for parsing messages of varied types in the same buffer. Models
/// the [`Iterator`][Iterator] API.
/// the [`Iterator`] API.
pub fn next_typed<TT, PP>(&mut self) -> Option<Result<Nlmsghdr<TT, PP>, SocketError>>
where
TT: NlType,
Expand Down
4 changes: 2 additions & 2 deletions src/nl.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! This module contains the top level netlink header code. Every
//! netlink message will be encapsulated in a top level `Nlmsghdr`.
//!
//! [`Nlmsghdr`][crate::nl::Nlmsghdr] is the structure representing a
//! [`Nlmsghdr`] is the structure representing a
//! header that all netlink protocols require to be passed to the
//! correct destination.
//!
//! # Design decisions
//!
//! Payloads for [`Nlmsghdr`][crate::nl::Nlmsghdr] can be any type.
//! Payloads for [`Nlmsghdr`] can be any type.
//!
//! The payload is wrapped in an enum to facilitate better
//! application-level error handling.
Expand Down
2 changes: 1 addition & 1 deletion src/router/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! to the request.
//! * Errors in packet reception and parsing are broadcast to all receivers.
//! * An [`NlRouterReceiverHandle`][crate::router::synchronous::NlRouterReceiverHandle]
//! can be used as an iterator and will return [`None`][None] either when all
//! can be used as an iterator and will return [`None`] either when all
//! messages corresponding to the request have been received or there is a fatal error.
//!
//! ## Design decisions
Expand Down
2 changes: 1 addition & 1 deletion src/router/synchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ where
T: NlType,
P: Size + FromBytesWithInput<Input = usize>,
{
/// Imitates the [`Iterator`][Iterator] API but allows parsing differently typed
/// Imitates the [`Iterator`] API but allows parsing differently typed
/// messages in a sequence of messages meant for this receiver.
pub fn next_typed<TT, PP>(&mut self) -> Option<Result<Nlmsghdr<TT, PP>, RouterError<TT, PP>>>
where
Expand Down
2 changes: 1 addition & 1 deletion src/rtnl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ where
Ok(())
}

/// Return an [`AttrHandle`][crate::attr::AttrHandle] for
/// Return an [`AttrHandle`] for
/// attributes nested in the given attribute payload.
pub fn get_attr_handle<R>(&self) -> Result<RtAttrHandle<R>, DeError>
where
Expand Down
6 changes: 3 additions & 3 deletions src/socket/synchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl NlSocketHandle {
Ok(())
}

/// Convenience function to read a stream of [`Nlmsghdr`][crate::nl::Nlmsghdr]
/// Convenience function to read a stream of [`Nlmsghdr`]
/// structs one by one using an iterator.
///
/// Returns [`None`] when the stream of messages has been completely processed in
Expand All @@ -103,13 +103,13 @@ impl NlSocketHandle {
Ok((NlBufferIter::new(Cursor::new(buffer)), groups))
}

/// Parse all [`Nlmsghdr`][crate::nl::Nlmsghdr] structs sent in
/// Parse all [`Nlmsghdr`] structs sent in
/// one network packet and return them all in a list.
///
/// Failure to parse any packet will cause the entire operation
/// to fail. If an error is detected at the application level,
/// this method will discard any non-error
/// [`Nlmsghdr`][crate::nl::Nlmsghdr] structs and only return the
/// [`Nlmsghdr`] structs and only return the
/// error. For a more granular approach, use [`NlSocketHandle::recv`].
pub fn recv_all<T, P>(&self) -> Result<(NlBuffer<T, P>, Groups), SocketError>
where
Expand Down

0 comments on commit c01b3a4

Please sign in to comment.