pub enum ComponentSourceError {
UnknownComponent(ComponentId),
NotImplemented(ComponentId),
ImmutableUpdate(ComponentId),
MismatchedMutation(ComponentId),
InvalidInboxId(InboxIdError),
MalformedComponentValue {
component_id: ComponentId,
reason: String,
},
UnknownMetadataField(String),
GroupMutableMetadata(GroupMutableMetadataError),
TlsCodec(Error),
TlsSetApply(TlsSetError),
TlsMapApply(TlsMapError),
FieldBoundExceeded {
component_id: ComponentId,
len: usize,
max: usize,
},
}Expand description
Errors surfaced by the component_source layer.
xmtp_mls embeds this in GroupError via #[from] for the
AppDataUpdate path.
Variants§
UnknownComponent(ComponentId)
The component id is outside the well-known XMTP range.
NotImplemented(ComponentId)
The component is known but its wiring hasn’t been built yet.
ImmutableUpdate(ComponentId)
An AppDataUpdate::Update write was attempted against an immutable
component. Insert-once writes should be expressed as Insert, not
caught here.
MismatchedMutation(ComponentId)
A mutation does not match the component type of the component it
targets (e.g. a scalar write to ADMIN_LIST).
InvalidInboxId(InboxIdError)
Failed to convert an inbox id string or byte slice into an
InboxId. Wraps InboxIdError — callers that need to
distinguish “not hex” from “wrong length” can match the inner
variant.
MalformedComponentValue
A wire-format violation on a component value: the bytes stored in
the AppData dictionary for a known component don’t decode under the
expected encoding (e.g. non-UTF-8 bytes for a Bytes-typed
metadata attribute, malformed TlsSet for a collection component).
Fields
component_id: ComponentIdThe component whose stored bytes failed to decode.
UnknownMetadataField(String)
A MetadataUpdate intent referenced a metadata field name that has
no corresponding ComponentId. Most commonly fires when a future
metadata field is added to one of the senders without also being
added to metadata_field_to_component_id.
GroupMutableMetadata(GroupMutableMetadataError)
Failed to read, decode, or encode the legacy group mutable metadata extension while servicing a component-source request.
TlsCodec(Error)
A TLS-codec operation on a delta or stored collection value failed.
TlsSetApply(TlsSetError)
A TlsSet::apply_delta call failed while synthesizing the new full
value of a collection component from an incoming delta.
TlsMapApply(TlsMapError)
A TlsMap::apply_delta call failed while synthesizing the new full
value of a map component from an incoming delta.
FieldBoundExceeded
An update would leave a bounded component holding a scalar,
collection element, or collection snapshot longer than its limit
(MAX_FIELD_ELEMENT_BYTES or MAX_FIELD_SNAPSHOT_BYTES).
Implementations§
Source§impl ComponentSourceError
impl ComponentSourceError
Sourcepub fn component_id(&self) -> Option<ComponentId>
pub fn component_id(&self) -> Option<ComponentId>
Best-effort ComponentId extraction for the variants that carry
one — so error-mapping shims can preserve structured context
across the crate boundary into
GroupMutableMetadataError::MalformedComponent without
stringifying.
Trait Implementations§
Source§impl Debug for ComponentSourceError
impl Debug for ComponentSourceError
Source§impl Display for ComponentSourceError
impl Display for ComponentSourceError
Source§impl Error for ComponentSourceError
impl Error for ComponentSourceError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ComponentSourceError> for FieldError
impl From<ComponentSourceError> for FieldError
Source§fn from(source: ComponentSourceError) -> Self
fn from(source: ComponentSourceError) -> Self
Source§impl From<ComponentSourceError> for GroupMutableMetadataError
impl From<ComponentSourceError> for GroupMutableMetadataError
Source§fn from(err: ComponentSourceError) -> Self
fn from(err: ComponentSourceError) -> Self
Preserve structure where possible. If the source already wraps a
GroupMutableMetadataError, unwrap and return that inner variant
verbatim so callers can
match on MissingExtension / MissingMetadataField / etc.
For every other variant, surface as MalformedComponent and
preserve the offending component_id when it’s available so
downstream consumers (bindings, error-mapping) can match
structurally on it. Variants without one surface as
component_id: None; the display string stays the
authoritative diagnostic.
Source§impl From<ComponentTypedError> for ComponentSourceError
impl From<ComponentTypedError> for ComponentSourceError
Source§fn from(err: ComponentTypedError) -> Self
fn from(err: ComponentTypedError) -> Self
Surface trait-layer errors at the dispatch boundary. The
dispatch layer adds UnknownComponent / NotImplemented /
UnknownMetadataField / GroupMutableMetadata for things the
trait can’t see; the variants below are the trait’s domain
and round-trip 1:1.
Source§impl From<Error> for ComponentSourceError
impl From<Error> for ComponentSourceError
Source§impl From<GroupMutableMetadataError> for ComponentSourceError
impl From<GroupMutableMetadataError> for ComponentSourceError
Source§fn from(source: GroupMutableMetadataError) -> Self
fn from(source: GroupMutableMetadataError) -> Self
Source§impl From<InboxIdError> for ComponentSourceError
impl From<InboxIdError> for ComponentSourceError
Source§fn from(source: InboxIdError) -> Self
fn from(source: InboxIdError) -> Self
Source§impl From<TlsMapError> for ComponentSourceError
impl From<TlsMapError> for ComponentSourceError
Source§fn from(source: TlsMapError) -> Self
fn from(source: TlsMapError) -> Self
Source§impl From<TlsSetError> for ComponentSourceError
impl From<TlsSetError> for ComponentSourceError
Source§fn from(source: TlsSetError) -> Self
fn from(source: TlsSetError) -> Self
Auto Trait Implementations§
impl Freeze for ComponentSourceError
impl RefUnwindSafe for ComponentSourceError
impl Send for ComponentSourceError
impl Sync for ComponentSourceError
impl Unpin for ComponentSourceError
impl UnsafeUnpin for ComponentSourceError
impl UnwindSafe for ComponentSourceError
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].