pub enum Error {
ConnectToServer,
WriteToStream,
ReadStream,
SwitchMode,
RunCommand,
QueryResponse(&'static str),
WrongResponse,
UnsupportedCommand((&'static str, Option<ChannelMode>)),
SonicServer(String),
}Expand description
Wrap for sonic channel error kind. This type has std::error::Error implementation and you can use boxed trait for catch other errors like this. All error kinds that you can see in sonic-channel crate.
Variants§
ConnectToServer
Cannot connect to the sonic search backend.
WriteToStream
Cannot write message to stream.
ReadStream
Cannot read message in stream.
SwitchMode
Cannot switch channel mode from uninitialized.
RunCommand
Cannot run command in current mode.
QueryResponse(&'static str)
Error in query response with additional message.
WrongResponse
Response from sonic server are wrong! Actually it may happen if you use unsupported sonic backend version. Please write issue to the github repo.
UnsupportedCommand((&'static str, Option<ChannelMode>))
You cannot run the command in current channel.
SonicServer(String)
This error appears if the error occurred on the server side
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more