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§
Source§impl ComponentId
impl ComponentId
Sourcepub const COMPONENT_REGISTRY: Self
pub const COMPONENT_REGISTRY: Self
The component registry. Super admin only.
Sourcepub const SUPER_ADMIN_LIST: Self
pub const SUPER_ADMIN_LIST: Self
The super admin list. Super admin only.
Sourcepub const ADMIN_LIST: Self
pub const ADMIN_LIST: Self
The admin list. Configurable: super admin only or admin/super admin.
pub const GROUP_MEMBERSHIP: Self
pub const GROUP_NAME: Self
pub const GROUP_DESCRIPTION: Self
pub const GROUP_IMAGE_URL: Self
pub const MESSAGE_DISAPPEAR_FROM_NS: Self
pub const MESSAGE_DISAPPEAR_IN_NS: Self
pub const APP_DATA: Self
pub const MIN_SUPPORTED_PROTOCOL_VERSION: Self
pub const COMMIT_LOG_SIGNER: Self
pub const CONVERSATION_TYPE: Self
pub const CREATOR_INBOX_ID: Self
pub const DM_MEMBERS: Self
pub const ONESHOT_MESSAGE: Self
pub const fn new(id: u16) -> Self
pub const fn as_u16(self) -> u16
Sourcepub 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.
Sourcepub 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).
Sourcepub 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).
Sourcepub 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).
Sourcepub 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.
Sourcepub 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.
Sourcepub 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§
Source§impl Clone for ComponentId
impl Clone for ComponentId
Source§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 moreSource§impl Debug for ComponentId
impl Debug for ComponentId
Source§impl Deserialize for ComponentId
impl Deserialize for ComponentId
Source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>where
Self: Sized,
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>where
Self: Sized,
bytes from the provided a std::io::Read
and returns the populated struct. Read moreSource§impl Display for ComponentId
impl Display for ComponentId
Source§impl From<ComponentId> for u16
impl From<ComponentId> for u16
Source§fn from(id: ComponentId) -> Self
fn from(id: ComponentId) -> Self
Source§impl From<u16> for ComponentId
impl From<u16> for ComponentId
Source§impl Hash for ComponentId
impl Hash for ComponentId
Source§impl Ord for ComponentId
impl Ord for ComponentId
Source§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,
Source§impl PartialEq for ComponentId
impl PartialEq for ComponentId
Source§fn eq(&self, other: &ComponentId) -> bool
fn eq(&self, other: &ComponentId) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ComponentId
impl PartialOrd for ComponentId
Source§impl Serialize for ComponentId
impl Serialize for ComponentId
Source§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> 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].