Trait SetSockOpt

Source
pub unsafe trait SetSockOpt<'a> {
    type ExtArg
       where Self: 'a;
    type OptVal;
    type Result;

    // Required methods
    fn prepare_setsockopt_args(
        &self,
        arg: &Self::ExtArg,
    ) -> (int, int, *const Self::OptVal, socklen_t);
    fn prepare_setsockopt_result(&self, raw: int) -> Self::Result;
}
Expand description

Implemented by options that can be used with setsockopt.

Safety: Implementers must ensure that they only generate valid combinations of setsockopt level, optname, optval, and optlen.

Required Associated Types§

Source

type ExtArg where Self: 'a

The type that the caller will provide when setting this option.

Source

type OptVal

The type that “optval” will be a pointer to in the call.

Source

type Result

The type of the result of the setsockopt call.

Required Methods§

Source

fn prepare_setsockopt_args( &self, arg: &Self::ExtArg, ) -> (int, int, *const Self::OptVal, socklen_t)

Prepare the arguments for a setsockopt system call. The tuple elements of the result are (level, optname, optval, optlen).

Source

fn prepare_setsockopt_result(&self, raw: int) -> Self::Result

Prepare a raw successful result from a setsockopt call to be returned.

Implementors§

Source§

impl<'a, T: 'a> SetSockOpt<'a> for DirectSockOpt<T>