UdsxUnixStream

Trait UdsxUnixStream 

Source
pub trait UdsxUnixStream {
    // Required methods
    fn send_streams<B, const N: usize>(
        &self,
        id: B,
        streams: [RawFd; N],
    ) -> Result<()>
       where B: AsRef<[u8]>;
    fn send_ioe<B>(&self, id: B) -> Result<()>
       where B: AsRef<[u8]>;
    unsafe fn recv_streams<B, T, const N: usize>(&self, id: B) -> Result<[T; N]>
       where B: AsRef<[u8]>,
             T: FromRawFd;
    unsafe fn recv_ioe<B>(&self, id: B) -> Result<[Stdio; 3]>
       where B: AsRef<[u8]>;
}
Available on Unix only.
Expand description

§Extensions for UnixStream

§Notes

  • IDs are used for verification, they must not be empty.
  • In tests, IDs with size from one byte up to 64 bytes work fine. So you can use something like SHA3-512 hashes as your IDs.

Required Methods§

Source

fn send_streams<B, const N: usize>( &self, id: B, streams: [RawFd; N], ) -> Result<()>
where B: AsRef<[u8]>,

§Sends streams
§Notes

Too much streams will make an error (see cmsg(3)).

§See also

recv_streams()

Source

fn send_ioe<B>(&self, id: B) -> Result<()>
where B: AsRef<[u8]>,

§Sends all standard streams: input, output, error
§See also

recv_ioe()

Source

unsafe fn recv_streams<B, T, const N: usize>(&self, id: B) -> Result<[T; N]>
where B: AsRef<[u8]>, T: FromRawFd,

§Receives streams

The number of streams you want to receive must match what client sends.

§See also

send_streams()

Source

unsafe fn recv_ioe<B>(&self, id: B) -> Result<[Stdio; 3]>
where B: AsRef<[u8]>,

§Receives standard streams sent by send_ioe()

Results are: input, output and error streams.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl UdsxUnixStream for UnixStream

Source§

fn send_streams<B, const N: usize>( &self, id: B, streams: [RawFd; N], ) -> Result<()>
where B: AsRef<[u8]>,

Source§

fn send_ioe<B>(&self, id: B) -> Result<()>
where B: AsRef<[u8]>,

Source§

unsafe fn recv_streams<B, T, const N: usize>(&self, id: B) -> Result<[T; N]>
where B: AsRef<[u8]>, T: FromRawFd,

Source§

unsafe fn recv_ioe<B>(&self, id: B) -> Result<[Stdio; 3]>
where B: AsRef<[u8]>,

Implementors§