[−][src]Struct nbd_netlink::NBDConnect
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]
&self,
nbd: &mut NBD,
sockets: impl IntoIterator<Item = &'a impl AsRawFd + 'a>
) -> Result<u32>
Tell the kernel to connect an NBD device to the specified sockets.
Returns the index of the newly connected NBD device.
Auto Trait Implementations
impl RefUnwindSafe for NBDConnect
[src]
impl Send for NBDConnect
[src]
impl Sync for NBDConnect
[src]
impl Unpin for NBDConnect
[src]
impl UnwindSafe for NBDConnect
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,