Struct taos_query::RawError
source · pub struct RawError { /* private fields */ }
Expand description
The Error
type, a wrapper around raw libtaos.so client errors or
dynamic error types that could be integrated into anyhow::Error.
§Constructions
We prefer to use format_err to construct errors, but you can always use constructor API in your codes.
§Constructor API
Use error code from native client. You can use it directly with error code
let error = Error::from_code(0x2603);
Or with error message from C API.
let error = Error::new(0x0216, r#"syntax error near "123);""#); // Syntax error in SQL
§Display representations
Implementations§
source§impl Error
impl Error
pub fn new_with_context( code: impl Into<Code>, err: impl Into<String>, context: impl Into<String> ) -> Error
pub fn new(code: impl Into<Code>, err: impl Into<String>) -> Error
pub fn context(self, context: impl Into<String>) -> Error
pub fn errno(&self) -> Code
👎Deprecated: Use self.code() instead
pub const fn code(&self) -> Code
pub fn message(&self) -> String
pub fn from_code(code: impl Into<Code>) -> Error
pub fn from_string(err: impl Into<Cow<'static, str>>) -> Error
pub fn from_any(err: impl Into<Error>) -> Error
pub fn any(err: impl Into<Error> + 'static) -> Error
pub fn success(&self) -> bool
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
source§fn provide<'_request>(&'_request self, request: &mut Request<'_request>)
fn provide<'_request>(&'_request self, request: &mut Request<'_request>)
🔬This is a nightly-only experimental API. (
error_generic_member_access
)Provides type based access to context intended for error reports. 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()
source§impl Error for Error
impl Error for Error
source§fn custom<T>(msg: T) -> Errorwhere
T: Display,
fn custom<T>(msg: T) -> Errorwhere
T: Display,
Raised when there is general error when deserializing a type. Read more
source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a type different from what it was
expecting. Read moresource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a value of the right type but that
is wrong for some other reason. Read moresource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Raised when deserializing a sequence or map and the input data contains
too many or too few elements. Read more
source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
enum type received a variant with an
unrecognized name.source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
struct type received a field with an
unrecognized name.source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type expected to receive a required
field with a particular name but that field was not present in the
input.source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type received more than one of the
same field.source§impl From<SmlDataBuilderError> for Error
impl From<SmlDataBuilderError> for Error
source§fn from(value: SmlDataBuilderError) -> Self
fn from(value: SmlDataBuilderError) -> Self
Converts to this type from the input type.
impl Send for Error
impl Sync for Error
Auto Trait Implementations§
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