pub trait UnixFDMessageExtManual: Sealed + IsA<UnixFDMessage> + Sized {
    // Provided methods
    fn append_fd<T: AsRawFd>(&self, fd: T) -> Result<(), Error> { ... }
    fn steal_fds(&self) -> Vec<RawFd> { ... }
}

Provided Methods§

source

fn append_fd<T: AsRawFd>(&self, fd: T) -> Result<(), Error>

Adds a file descriptor to @self.

The file descriptor is duplicated using dup(). You keep your copy of the descriptor and the copy contained in @self will be closed when @self is finalized.

A possible cause of failure is exceeding the per-process or system-wide file descriptor limit.

§fd

a valid open file descriptor

§Returns

true in case of success, else false (and @error is set)

source

fn steal_fds(&self) -> Vec<RawFd>

Returns the array of file descriptors that is contained in this object.

After this call, the descriptors are no longer contained in @self. Further calls will return an empty list (unless more descriptors have been added).

The return result of this function must be freed with g_free(). The caller is also responsible for closing all of the file descriptors.

If @length is non-None then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.

This function never returns None. In case there are no file descriptors contained in @self, an empty array is returned.

§Returns

an array of file descriptors

Object Safety§

This trait is not object safe.

Implementors§