pub enum Error {
Show 16 variants
MissingPositionInput,
MissingPriceInput,
MissingFaceValue,
MissingCouponRate,
MissingMaturityDate,
MissingIssueDate,
NotABondSecurity,
MissingSecurityInput,
MissingBaseCpi,
MissingCpi,
MissingMeasure(MeasureProto),
DecimalConversion,
DateConversion,
UuidError,
DeserializationError,
Validation(Vec<FieldViolationProto>),
}Variants§
MissingPositionInput
MissingPriceInput
MissingFaceValue
MissingCouponRate
MissingMaturityDate
MissingIssueDate
NotABondSecurity
MissingSecurityInput
MissingBaseCpi
MissingCpi
MissingMeasure(MeasureProto)
DecimalConversion
DateConversion
UuidError
DeserializationError
Validation(Vec<FieldViolationProto>)
Typed input error (docs/adr/typed-input-errors.md): the object has one
or more bad fields. Never empty. Maps to Code::InvalidArgument.
Implementations§
Source§impl Error
impl Error
Sourcepub fn violations(&self) -> &[FieldViolationProto]
pub fn violations(&self) -> &[FieldViolationProto]
Field-level violations of a Validation error; empty for other variants.
Sourcepub fn in_field(self, name: &str) -> Error
pub fn in_field(self, name: &str) -> Error
Labels a Validation error with the field the caller decoded it from,
e.g. deserialize_decimal(p).map_err(|e| e.in_field("price")). Every
violation is prefixed: an empty field becomes name, a field f
becomes name.f. Other variants are returned unchanged.
Trait Implementations§
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(_: ParseError) -> Self
fn from(_: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request