Trait GetSockOpt

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

    // Required methods
    fn prepare_getsockopt_args(&self) -> (int, int);
    fn prepare_getsockopt_result(
        &self,
        retval: int,
        optval: Self::OptVal,
    ) -> Self::Result;
}
Expand description

Implemented by options that can be used with getsockopt.

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

Required Associated Types§

Source

type OptVal

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

Source

type Result where Self: 'a

The type of the result of the getsockopt call.

Required Methods§

Source

fn prepare_getsockopt_args(&self) -> (int, int)

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

Source

fn prepare_getsockopt_result( &self, retval: int, optval: Self::OptVal, ) -> Self::Result

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

Implementors§

Source§

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

Source§

impl<'a, T: 'a> GetSockOpt<'a> for DirectSockOptReadOnly<T>