[][src]Struct nbd_netlink::NBDConnect

pub struct NBDConnect { /* fields omitted */ }

A builder for an NBD connect call.

Implementations

impl NBDConnect[src]

pub fn new() -> Self[src]

Create a new NBDConnect builder.

pub fn size_bytes(&mut self, bytes: u64) -> &mut Self[src]

Set the size for the NBD device, in bytes. Defaults to 0 if not specified.

pub fn block_size(&mut self, bytes: u64) -> &mut Self[src]

Set the minimum block size for the NBD device, in bytes. Defaults to 4096 if not specified.

pub fn read_only(&mut self, read_only: bool) -> &mut Self[src]

Set the device as read-only.

pub fn can_multi_conn(&mut self, can_multi_conn: bool) -> &mut Self[src]

Set the device as allowing multiple concurrent socket connections.

pub fn disconnect_on_close(&mut self, disconnect_on_close: bool) -> &mut Self[src]

Set the device to disconnect the NBD connection when closed for the last time.

pub fn connect<'a>(
    &self,
    nbd: &mut NBD,
    sockets: impl IntoIterator<Item = &'a impl AsRawFd + 'a>
) -> Result<u32>
[src]

Tell the kernel to connect an NBD device to the specified sockets.

Returns the index of the newly connected NBD device.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.