Skip to main content

OptionReplyError

Enum OptionReplyError 

Source
#[repr(u32)]
pub enum OptionReplyError { Unsupported = 2_147_483_649, Policy = 2_147_483_650, Invalid = 2_147_483_651, Platform = 2_147_483_652, TLSRequired = 2_147_483_653, UnknownExport = 2_147_483_654, Shutdown = 2_147_483_655, BlockSizeRequired = 2_147_483_656, TooBig = 2_147_483_657, ExtendedHeaderRequired = 2_147_483_658, }
Expand description

Errors that can occur during the option negotiation phase of the NBD protocol.

These errors are sent in reply to option requests from the client during the handshake and negotiation phase. All of these error codes have bit 31 set (0x80000000) to distinguish them from successful replies.

Each error provides specific information about why an option request failed, allowing clients to make informed decisions about how to proceed.

Variants§

§

Unsupported = 2_147_483_649

The option sent by the client is unknown by this server implementation.

This may occur because the server is too old or from another source that doesn’t support the requested option.

Corresponds to NBD_REP_ERR_UNSUP (2^31 + 1).

§

Policy = 2_147_483_650

The option sent by the client is known but forbidden by server policy.

The server recognizes the option and it’s syntactically valid, but server-side policy forbids the server to allow the option (e.g., the client sent NBD_OPT_LIST but server configuration has that disabled).

Corresponds to NBD_REP_ERR_POLICY (2^31 + 2).

§

Invalid = 2_147_483_651

The option sent by the client is known but syntactically or semantically invalid.

For instance, the client sent an NBD_OPT_LIST with nonzero data length, or the client sent a second NBD_OPT_STARTTLS after TLS was already negotiated.

Corresponds to NBD_REP_ERR_INVALID (2^31 + 3).

§

Platform = 2_147_483_652

The option is not supported on the platform where the server is running.

This error occurs when an option requires compile-time options that were disabled on the server, e.g., when trying to use TLS but the server was built without TLS support.

Corresponds to NBD_REP_ERR_PLATFORM (2^31 + 4).

§

TLSRequired = 2_147_483_653

The server requires TLS to be initiated before continuing negotiation.

For NBD_OPT_INFO and NBD_OPT_GO, this unwillingness may be limited to the export in question, depending on the TLS mode.

Corresponds to NBD_REP_ERR_TLS_REQD (2^31 + 5).

§

UnknownExport = 2_147_483_654

The requested export is not available on the server.

This is typically returned when a client attempts to connect to an export that doesn’t exist or isn’t configured on the server.

Corresponds to NBD_REP_ERR_UNKNOWN (2^31 + 6).

§

Shutdown = 2_147_483_655

The server is in the process of shutting down.

The server is unwilling to continue negotiation as it is being shut down.

Corresponds to NBD_REP_ERR_SHUTDOWN (2^31 + 7).

§

BlockSizeRequired = 2_147_483_656

The server requires block size information before proceeding.

The server is unwilling to enter transmission phase for a given export unless the client first acknowledges (via NBD_INFO_BLOCK_SIZE) that it will obey non-default block sizing requirements.

Corresponds to NBD_REP_ERR_BLOCK_SIZE_REQD (2^31 + 8).

§

TooBig = 2_147_483_657

The request or reply is too large for the server to process.

This can occur when a client sends a request that exceeds the server’s processing capabilities, or when a reply would be too large to send.

Corresponds to NBD_REP_ERR_TOO_BIG (2^31 + 9).

§

ExtendedHeaderRequired = 2_147_483_658

The server requires extended headers for the operation.

This is defined by the experimental EXTENDED_HEADERS extension to the NBD protocol.

Corresponds to NBD_REP_ERR_EXT_HEADER_REQD (2^31 + 10).

Trait Implementations§

Source§

impl Clone for OptionReplyError

Source§

fn clone(&self) -> OptionReplyError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OptionReplyError

Source§

impl Debug for OptionReplyError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for OptionReplyError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OptionReplyError

Source§

impl Error for OptionReplyError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<OptionReplyError> for u32

Source§

fn from(v: OptionReplyError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for OptionReplyError

Source§

fn eq(&self, other: &OptionReplyError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for OptionReplyError

Source§

impl TryFrom<u32> for OptionReplyError

Source§

type Error = u32

The type returned in the event of a conversion error.
Source§

fn try_from(v: u32) -> Result<Self, u32>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more