Skip to main content

KnxError

Enum KnxError 

Source
pub enum KnxError {
Show 50 variants InvalidGroupAddress(String), InvalidIndividualAddress(String), AddressOutOfRange { address: String, valid_range: String, }, InvalidDpt(String), DptEncoding { dpt: String, reason: String, }, DptDecoding { dpt: String, reason: String, }, DptValueOutOfRange { value: String, valid_range: String, }, FrameTooShort { expected: usize, actual: usize, }, InvalidHeader(String), InvalidProtocolVersion { expected: u8, actual: u8, }, UnknownServiceType(u16), FrameLengthMismatch { header_length: usize, actual_length: usize, }, InvalidHpai(String), UnknownMessageCode(u8), InvalidCemi(String), UnknownApci(u16), ConnectionFailed { address: SocketAddr, reason: String, }, ConnectionTimeout { timeout_ms: u64, }, ConnectionClosed(String), NoMoreConnections { max: usize, }, InvalidChannel(u8), SequenceError { expected: u8, actual: u8, }, DuplicateFrame { sequence: u8, expected: u8, }, OutOfOrderFrame { sequence: u8, expected: u8, distance: u8, }, FatalDesync { sequence: u8, expected: u8, distance: u8, }, SendErrorThresholdExceeded { consecutive_errors: u32, threshold: u32, }, TunnelError(String), TunnelTimeout { channel_id: u8, }, TunnelAckError { status: u8, }, AckTimeout { channel_id: u8, sequence: u8, attempts: u8, }, ConfirmationNack { channel_id: u8, }, ConfirmationTimeout { channel_id: u8, sequence: u8, }, InvalidStateTransition { from: String, to: String, }, ChannelMismatch { expected: u8, actual: u8, }, FlowControlDrop { reason: String, }, FlowControlQueued { channel_id: u8, }, CircuitBreakerOpen { consecutive_failures: u32, threshold: u32, }, PaceFilterDelayExceeded { delay_ms: u64, max_delay_ms: u64, }, GroupObjectNotFound(String), GroupObjectWriteNotAllowed(String), GroupObjectReadNotAllowed(String), Server(String), ServerNotRunning, ServerAlreadyRunning, BindError { address: SocketAddr, reason: String, }, Config(String), InvalidConfigValue { field: String, reason: String, }, Io(Error), Core(Error), Internal(String),
}
Expand description

KNX error types.

Variants§

§

InvalidGroupAddress(String)

Invalid group address format.

§

InvalidIndividualAddress(String)

Invalid individual address format.

§

AddressOutOfRange

Address out of range.

Fields

§address: String
§valid_range: String
§

InvalidDpt(String)

Invalid datapoint type.

§

DptEncoding

DPT encoding error.

Fields

§reason: String
§

DptDecoding

DPT decoding error.

Fields

§reason: String
§

DptValueOutOfRange

DPT value out of range.

Fields

§value: String
§valid_range: String
§

FrameTooShort

Frame too short.

Fields

§expected: usize
§actual: usize
§

InvalidHeader(String)

Invalid frame header.

§

InvalidProtocolVersion

Invalid protocol version.

Fields

§expected: u8
§actual: u8
§

UnknownServiceType(u16)

Unknown service type.

§

FrameLengthMismatch

Frame length mismatch.

Fields

§header_length: usize
§actual_length: usize
§

InvalidHpai(String)

Invalid HPAI (Host Protocol Address Information).

§

UnknownMessageCode(u8)

Unknown cEMI message code.

§

InvalidCemi(String)

Invalid cEMI frame.

§

UnknownApci(u16)

Unknown APCI.

§

ConnectionFailed

Connection failed.

Fields

§address: SocketAddr
§reason: String
§

ConnectionTimeout

Connection timeout.

Fields

§timeout_ms: u64
§

ConnectionClosed(String)

Connection closed.

§

NoMoreConnections

No more connections available.

Fields

§max: usize
§

InvalidChannel(u8)

Invalid channel ID.

§

SequenceError

Sequence error.

Fields

§expected: u8
§actual: u8
§

DuplicateFrame

Duplicate frame detected.

Fields

§sequence: u8
§expected: u8
§

OutOfOrderFrame

Out-of-order frame detected.

Fields

§sequence: u8
§expected: u8
§distance: u8
§

FatalDesync

Fatal sequence desync (knxd: seqno >= rno + 5).

Fields

§sequence: u8
§expected: u8
§distance: u8
§

SendErrorThresholdExceeded

Send error threshold exceeded.

Fields

§consecutive_errors: u32
§threshold: u32
§

TunnelError(String)

Tunnel connection error.

§

TunnelTimeout

Tunnel request timeout.

Fields

§channel_id: u8
§

TunnelAckError

Tunnel ACK error.

Fields

§status: u8
§

AckTimeout

Tunnel ACK timeout after retries.

Fields

§channel_id: u8
§sequence: u8
§attempts: u8
§

ConfirmationNack

L_Data.con confirmation failure (Ctrl1 bit 0 = 1).

Fields

§channel_id: u8
§

ConfirmationTimeout

L_Data.con confirmation timeout.

Fields

§channel_id: u8
§sequence: u8
§

InvalidStateTransition

Tunnel state transition error.

Fields

§from: String
§

ChannelMismatch

Channel ID mismatch.

Fields

§expected: u8
§actual: u8
§

FlowControlDrop

Frame dropped by flow control filter.

Fields

§reason: String
§

FlowControlQueued

Frame queued by flow control (not an error, informational).

Fields

§channel_id: u8
§

CircuitBreakerOpen

Circuit breaker is open, dropping frames.

Fields

§consecutive_failures: u32
§threshold: u32
§

PaceFilterDelayExceeded

PaceFilter delay exceeded maximum allowed.

Fields

§delay_ms: u64
§max_delay_ms: u64
§

GroupObjectNotFound(String)

Group object not found.

§

GroupObjectWriteNotAllowed(String)

Group object write not allowed.

§

GroupObjectReadNotAllowed(String)

Group object read not allowed.

§

Server(String)

Server error.

§

ServerNotRunning

Server not running.

§

ServerAlreadyRunning

Server already running.

§

BindError

Bind error.

Fields

§address: SocketAddr
§reason: String
§

Config(String)

Configuration error.

§

InvalidConfigValue

Invalid configuration value.

Fields

§field: String
§reason: String
§

Io(Error)

I/O error.

§

Core(Error)

Core error.

§

Internal(String)

Internal error.

Implementations§

Source§

impl KnxError

Source

pub fn frame_too_short(expected: usize, actual: usize) -> Self

Create a frame too short error.

Source

pub fn connection_failed(address: SocketAddr, reason: impl Into<String>) -> Self

Create a connection failed error.

Source

pub fn dpt_encoding(dpt: impl Into<String>, reason: impl Into<String>) -> Self

Create a DPT encoding error.

Source

pub fn dpt_decoding(dpt: impl Into<String>, reason: impl Into<String>) -> Self

Create a DPT decoding error.

Source

pub fn sequence_error(expected: u8, actual: u8) -> Self

Create a sequence error.

Source

pub fn is_recoverable(&self) -> bool

Check if this is a recoverable error.

Source

pub fn is_flow_control_error(&self) -> bool

Check if this is a flow control related error.

Source

pub fn requires_tunnel_restart(&self) -> bool

Check if this requires tunnel restart.

Source

pub fn is_protocol_error(&self) -> bool

Check if this is a protocol error.

Source

pub fn is_config_error(&self) -> bool

Check if this is a configuration error.

Trait Implementations§

Source§

impl Debug for KnxError

Source§

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

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

impl Display for KnxError

Source§

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

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

impl Error for KnxError

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<Error> for KnxError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for KnxError

Source§

fn from(source: CoreError) -> Self

Converts to this type from the input type.
Source§

impl From<KnxError> for Error

Source§

fn from(err: KnxError) -> Self

Converts to this type from the input type.

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> 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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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