Skip to content

Commit

Permalink
Merge #1524
Browse files Browse the repository at this point in the history
1524: Add docs for most sockopts r=asomers a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
  • Loading branch information
bors[bot] and asomers committed Sep 13, 2021
2 parents 1b7e485 + af29f2e commit b45d842
Show file tree
Hide file tree
Showing 2 changed files with 287 additions and 94 deletions.
11 changes: 5 additions & 6 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::sys::time::TimeVal;
use crate::sys::uio::IoVec;

mod addr;
#[deny(missing_docs)]
pub mod sockopt;

/*
Expand Down Expand Up @@ -1714,21 +1715,19 @@ pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result<usize> {
*
*/

/// Represents a socket option that can be accessed or set. Used as an argument
/// to `getsockopt`
/// Represents a socket option that can be retrieved.
pub trait GetSockOpt : Copy {
type Val;

#[doc(hidden)]
/// Look up the value of this socket option on the given socket.
fn get(&self, fd: RawFd) -> Result<Self::Val>;
}

/// Represents a socket option that can be accessed or set. Used as an argument
/// to `setsockopt`
/// Represents a socket option that can be set.
pub trait SetSockOpt : Clone {
type Val;

#[doc(hidden)]
/// Set the value of this socket option on the given socket.
fn set(&self, fd: RawFd, val: &Self::Val) -> Result<()>;
}

Expand Down

0 comments on commit b45d842

Please sign in to comment.