Struct ComponentId
pub struct ComponentId(/* private fields */);Expand description
A component identifier in the XMTP app data system.
ComponentIds occupy the top half of the u16 space (0x8000-0xFFFF), split
between XMTP protocol use (0x8000-0xBFFF) and application-defined
components (0xC000-0xFEFF), with 0xFF00-0xFFFF reserved.
Immutable ranges sit at the end of each block (last 512 IDs, counting down). Components in these ranges can be written once but never updated or deleted.
Implementations§
§impl ComponentId
impl ComponentId
pub const COMPONENT_REGISTRY: ComponentId
pub const COMPONENT_REGISTRY: ComponentId
The component registry. Super admin only.
pub const SUPER_ADMIN_LIST: ComponentId
pub const SUPER_ADMIN_LIST: ComponentId
The super admin list. Super admin only.
pub const ADMIN_LIST: ComponentId
pub const ADMIN_LIST: ComponentId
The admin list. Configurable: super admin only or admin/super admin.
pub const GROUP_MEMBERSHIP: ComponentId
pub const GROUP_NAME: ComponentId
pub const GROUP_DESCRIPTION: ComponentId
pub const GROUP_IMAGE_URL: ComponentId
pub const MESSAGE_DISAPPEAR_FROM_NS: ComponentId
pub const MESSAGE_DISAPPEAR_IN_NS: ComponentId
pub const APP_DATA: ComponentId
pub const MIN_SUPPORTED_PROTOCOL_VERSION: ComponentId
pub const COMMIT_LOG_SIGNER: ComponentId
pub const USER_DISPLAY_NAME: ComponentId
pub const USER_DISPLAY_NAME: ComponentId
Per-inbox display names: TlsMap<InboxId, UTF-8 bytes>.
pub const GROUP_IMAGE: ComponentId
pub const GROUP_IMAGE: ComponentId
Opaque group image bytes, such as a remote attachment descriptor.
pub const CONVERSATION_TYPE: ComponentId
pub const CREATOR_INBOX_ID: ComponentId
pub const DM_MEMBERS: ComponentId
pub const ONESHOT_MESSAGE: ComponentId
pub const GROUP_ROOT_KEY: ComponentId
pub const GROUP_ROOT_KEY: ComponentId
The 32-byte group root that every key of the group derives from. Written once at creation; a restored placeholder has none.
pub const WELL_KNOWN_NAMES: [(ComponentId, &'static str); 19]
pub const WELL_KNOWN_NAMES: [(ComponentId, &'static str); 19]
Every well-known component and its META section 2 name, in ID order,
built from xmtp_configuration::WELL_KNOWN_COMPONENT_NAMES.
pub fn from_well_known_name(name: &str) -> Option<ComponentId>
pub fn from_well_known_name(name: &str) -> Option<ComponentId>
The well-known component with exactly this name.
pub const fn new(id: u16) -> ComponentId
pub const fn as_u16(self) -> u16
pub fn event_name(self) -> String
pub fn event_name(self) -> String
Name this component in a metadata change event.
pub const fn is_in_component_space(self) -> bool
pub const fn is_in_component_space(self) -> bool
Returns true if the ID is in the component ID space (top half of u16).
Note: this includes the reserved range (0xFF00-0xFFFF); use
is_reserved to distinguish.
pub const fn is_xmtp_range(self) -> bool
pub const fn is_xmtp_range(self) -> bool
Returns true if the ID is in the XMTP protocol range (0x8000-0xBFFF).
pub const fn is_app_range(self) -> bool
pub const fn is_app_range(self) -> bool
Returns true if the ID is in the application range (0xC000-0xFEFF).
pub const fn is_reserved(self) -> bool
pub const fn is_reserved(self) -> bool
Returns true if the ID is in the reserved range (0xFF00-0xFFFF).
pub const fn is_immutable(self) -> bool
pub const fn is_immutable(self) -> bool
Returns true if the ID is in an immutable range. Immutable components can be inserted once but never updated or deleted.
pub const fn is_hardcoded(self) -> bool
pub const fn is_hardcoded(self) -> bool
Returns true if this is one of the hardcoded components whose permissions are enforced in code rather than the component registry.
pub const fn is_constrained(self) -> bool
pub const fn is_constrained(self) -> bool
Returns true if this component has constrained permission values.
Constrained components can only have their permissions set to the
proto base policies AllowIfAdmin (admin or super admin) or
AllowIfSuperAdmin (super admin only).
Trait Implementations§
§impl Clone for ComponentId
impl Clone for ComponentId
§fn clone(&self) -> ComponentId
fn clone(&self) -> ComponentId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ComponentId
impl Debug for ComponentId
§impl Deserialize for ComponentId
impl Deserialize for ComponentId
§fn tls_deserialize<R>(bytes: &mut R) -> Result<ComponentId, Error>
fn tls_deserialize<R>(bytes: &mut R) -> Result<ComponentId, Error>
bytes from the provided a std::io::Read
and returns the populated struct. Read more§impl Display for ComponentId
impl Display for ComponentId
§impl From<ComponentId> for u16
impl From<ComponentId> for u16
§fn from(id: ComponentId) -> u16
fn from(id: ComponentId) -> u16
§impl From<u16> for ComponentId
impl From<u16> for ComponentId
§fn from(id: u16) -> ComponentId
fn from(id: u16) -> ComponentId
§impl Hash for ComponentId
impl Hash for ComponentId
§impl Ord for ComponentId
impl Ord for ComponentId
§fn cmp(&self, other: &ComponentId) -> Ordering
fn cmp(&self, other: &ComponentId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for ComponentId
impl PartialEq for ComponentId
§impl PartialOrd for ComponentId
impl PartialOrd for ComponentId
§impl Serialize for ComponentId
impl Serialize for ComponentId
§impl Size for ComponentId
impl Size for ComponentId
fn tls_serialized_len(&self) -> usize
impl Copy for ComponentId
impl Eq for ComponentId
impl StructuralPartialEq for ComponentId
Auto Trait Implementations§
impl Freeze for ComponentId
impl RefUnwindSafe for ComponentId
impl Send for ComponentId
impl Sync for ComponentId
impl Unpin for ComponentId
impl UnsafeUnpin for ComponentId
impl UnwindSafe for ComponentId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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].