#[repr(C)]pub struct ErrorMsg {
pub hd: RecordHeader,
pub err: [c_char; 302],
pub code: u8,
pub is_last: u8,
}Expand description
An error message from the Databento Live Subscription Gateway (LSG).
Fields§
§hd: RecordHeaderThe common header.
err: [c_char; 302]The error message.
code: u8The error code. See the ErrorCode enum
for possible values.
is_last: u8Sometimes multiple errors are sent together. This field will be non-zero for the last error.
Implementations§
Source§impl ErrorMsg
impl ErrorMsg
Sourcepub fn new(
ts_event: u64,
code: Option<ErrorCode>,
msg: &str,
is_last: bool,
) -> Self
pub fn new( ts_event: u64, code: Option<ErrorCode>, msg: &str, is_last: bool, ) -> Self
Creates a new ErrorMsg. msg will be truncated if it’s too long.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorMsg
impl<'de> Deserialize<'de> for ErrorMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<&'a ErrorMsg> for RecordRefEnum<'a>
impl<'a> From<&'a ErrorMsg> for RecordRefEnum<'a>
Source§impl From<&ErrorMsgV1> for ErrorMsg
impl From<&ErrorMsgV1> for ErrorMsg
Source§impl From<ErrorMsg> for RecordEnum
impl From<ErrorMsg> for RecordEnum
Source§impl<'py> IntoPyObject<'py> for ErrorMsg
impl<'py> IntoPyObject<'py> for ErrorMsg
Source§type Output = Bound<'py, <ErrorMsg as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <ErrorMsg as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PartialOrd for ErrorMsg
impl PartialOrd for ErrorMsg
Source§impl PyClassImpl for ErrorMsg
impl PyClassImpl for ErrorMsg
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = /// An error message from the Databento Live Subscription Gateway (LSG).
const RAW_DOC: &'static CStr = /// An error message from the Databento Live Subscription Gateway (LSG).
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<ErrorMsg>
type ThreadChecker = SendablePyClass<ErrorMsg>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn dict_offset() -> Option<Py_ssize_t>
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for ErrorMsg
Available on crate feature python only.
impl PyClassNewTextSignature for ErrorMsg
Available on crate feature
python only.const TEXT_SIGNATURE: &'static str = "(ts_event, err, is_last=True, code=None)"
Source§impl PyMethods<ErrorMsg> for PyClassImplCollector<ErrorMsg>
Available on crate feature python only.
impl PyMethods<ErrorMsg> for PyClassImplCollector<ErrorMsg>
Available on crate feature
python only.fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for ErrorMsg
impl PyTypeInfo for ErrorMsg
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
Source§impl Record for ErrorMsg
impl Record for ErrorMsg
Source§fn header(&self) -> &RecordHeader
fn header(&self) -> &RecordHeader
Returns a reference to the
RecordHeader that comes at the beginning of all
record types.Source§fn record_size(&self) -> usize
fn record_size(&self) -> usize
Returns the size of the record in bytes.
Source§fn rtype(&self) -> Result<RType>
fn rtype(&self) -> Result<RType>
Tries to convert the raw record type into an enum which is useful for exhaustive
pattern matching. Read more
Source§fn publisher(&self) -> Result<Publisher>
fn publisher(&self) -> Result<Publisher>
Tries to convert the raw
publisher_id into an enum which is useful for
exhaustive pattern matching. Read moreSource§fn raw_index_ts(&self) -> u64
fn raw_index_ts(&self) -> u64
Returns the raw primary timestamp for the record. Read more
Source§fn index_ts(&self) -> Option<OffsetDateTime>
fn index_ts(&self) -> Option<OffsetDateTime>
Returns the primary timestamp for the record. Returns
None if the primary
timestamp contains the sentinel value for a null timestamp. Read moreSource§fn index_date(&self) -> Option<Date>
fn index_date(&self) -> Option<Date>
Returns the primary date for the record; the date component of the primary
timestamp (
index_ts()). Returns None if the primary timestamp contains the
sentinel value for a null timestamp.Source§impl RecordMut for ErrorMsg
impl RecordMut for ErrorMsg
Source§fn header_mut(&mut self) -> &mut RecordHeader
fn header_mut(&mut self) -> &mut RecordHeader
Returns a mutable reference to the
RecordHeader that comes at the beginning of
all record types.impl Copy for ErrorMsg
impl DerefToPyAny for ErrorMsg
impl Eq for ErrorMsg
impl StructuralPartialEq for ErrorMsg
Auto Trait Implementations§
impl Freeze for ErrorMsg
impl RefUnwindSafe for ErrorMsg
impl Send for ErrorMsg
impl Sync for ErrorMsg
impl Unpin for ErrorMsg
impl UnwindSafe for ErrorMsg
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.