pub enum EthercatError<T = ()> {
Io(Arc<Error>),
Slave(SlaveAddress, T),
Master(&'static str),
Protocol(&'static str),
Timeout(&'static str),
}Expand description
general object reporting an unexpected result regarding ethercat communication
Its variant are meant to help finding the cause responsible for the problem and how to deal with it.
Self::Slave variant should not be used without an appropriate type for T, T depend on the operation the slave reports for, and is usually an error code, or an enum.
Variants§
Io(Arc<Error>)
error caused by communication support
these errors are exterior to this library
Slave(SlaveAddress, T)
error reported by a slave, its type depend on the operation returning this error
these errors can generally be handled and fixed by retrying the operation or reconfiguring the slave
Master(&'static str)
error reported by the master
these errors can generally be handled and fixed by retrying the operation or using the master differently when the issue is in the user code
Protocol(&'static str)
error detected by the master in the ethercat communication
these errors can generally not be fixed and the whole communication has to be restarted
Timeout(&'static str)
error is due to too much time elapsed, but does not compromise the communication
these errors are generally contextual and the operation can be retried.
Implementations§
Source§impl<E> EthercatError<E>
impl<E> EthercatError<E>
Sourcepub fn into<F>(self) -> EthercatError<F>where
F: From<E>,
pub fn into<F>(self) -> EthercatError<F>where
F: From<E>,
convert the error if the slave specific error type allows it
Sourcepub fn map<F, T>(self, callback: F) -> EthercatError<T>where
F: Fn(E) -> T,
pub fn map<F, T>(self, callback: F) -> EthercatError<T>where
F: Fn(E) -> T,
convert the error with a callback handling the case of slave-specific error
Source§impl EthercatError<()>
impl EthercatError<()>
Sourcepub fn upgrade<F>(self) -> EthercatError<F>
pub fn upgrade<F>(self) -> EthercatError<F>
convert an error with no slave-specific type into an error with
Trait Implementations§
Source§impl<T: Clone> Clone for EthercatError<T>
impl<T: Clone> Clone for EthercatError<T>
Source§fn clone(&self) -> EthercatError<T>
fn clone(&self) -> EthercatError<T>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for EthercatError<T>
impl<T: Debug> Debug for EthercatError<T>
Source§impl<T: Debug> Display for EthercatError<T>
impl<T: Debug> Display for EthercatError<T>
Source§impl<T: Debug> Error for EthercatError<T>
impl<T: Debug> Error for EthercatError<T>
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl<T> From<Error> for EthercatError<T>
impl<T> From<Error> for EthercatError<T>
Source§impl From<EthercatError<MailboxError>> for EthercatError<CanError>
impl From<EthercatError<MailboxError>> for EthercatError<CanError>
Source§fn from(src: EthercatError<MailboxError>) -> Self
fn from(src: EthercatError<MailboxError>) -> Self
Source§impl From<EthercatError> for EthercatError<&str>
impl From<EthercatError> for EthercatError<&str>
Source§fn from(src: EthercatError<()>) -> Self
fn from(src: EthercatError<()>) -> Self
Source§impl From<EthercatError> for EthercatError<AlError>
impl From<EthercatError> for EthercatError<AlError>
Source§fn from(src: EthercatError<()>) -> Self
fn from(src: EthercatError<()>) -> Self
Source§impl From<EthercatError> for EthercatError<CanError>
impl From<EthercatError> for EthercatError<CanError>
Source§fn from(src: EthercatError<()>) -> Self
fn from(src: EthercatError<()>) -> Self
Source§impl From<EthercatError> for EthercatError<SiiError>
impl From<EthercatError> for EthercatError<SiiError>
Source§fn from(src: EthercatError<()>) -> Self
fn from(src: EthercatError<()>) -> Self
Source§impl<T> From<PackingError> for EthercatError<T>
impl<T> From<PackingError> for EthercatError<T>
Source§fn from(src: PackingError) -> Self
fn from(src: PackingError) -> Self
Auto Trait Implementations§
impl<T> Freeze for EthercatError<T>where
T: Freeze,
impl<T = ()> !RefUnwindSafe for EthercatError<T>
impl<T> Send for EthercatError<T>where
T: Send,
impl<T> Sync for EthercatError<T>where
T: Sync,
impl<T> Unpin for EthercatError<T>where
T: Unpin,
impl<T = ()> !UnwindSafe for EthercatError<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.