Skip to main content

Database

Struct Database 

Source
pub struct Database { /* private fields */ }
Expand description

The authoritative event store and projection boundary for one local identity.

Built-in reducers and projection tables are not part of the external API:

ⓘ
let _ = rostra_client_db::Database::process_event_content_inserted_tx;
ⓘ
let _ = rostra_client_db::events_singletons_new::TABLE;
ⓘ
let _ = rostra_client_db::Database::write_with::<()>;
ⓘ
let _ = rostra_client_db::Database::write_with_inner::<()>;
ⓘ
let _ = rostra_client_db::Database::read_with::<()>;
ⓘ
let _: Option<rostra_client_db::WriteTransactionCtx> = None;
ⓘ
rostra_client_db::def_table!(forbidden: u64 => u64);

Implementations§

Source§

impl Database

Source

pub async fn is_event_content_missing(&self, event_id: ShortEventId) -> bool

Check if an event’s content is in the missing state.

Source

pub async fn peek_next_missing_content(&self) -> Option<NextMissingContent>

Peek at the next missing content entry (earliest scheduled fetch).

Transactionally removes inconsistent entries from the front of events_content_missing, then returns the first entry whose timestamp matches the event’s current Missing state. Returns None if no valid entry remains.

Source

pub async fn record_failed_content_fetch( &self, event_id: ShortEventId, old_scheduled_time: Timestamp, attempted_at: Timestamp, next_attempt_at: Timestamp, )

Record a failed content fetch attempt.

Updates the events_content_missing schedule entry and the events_content_state metadata for the given event.

The caller provides both the factual time of the attempt (attempted_at) and the scheduling decision (next_attempt_at). The backoff calculation lives in the fetcher, not in the DB layer.

The update is compare-and-set against old_scheduled_time. If another completion or a terminal content transition already changed the current state, this stale completion has no effect. The replacement schedule must be strictly later than the observed schedule so a schedule value cannot be reused as an ABA-prone compare-and-set token.

Source

pub async fn paginate_missing_events_contents( &self, cursor: Option<(Timestamp, ShortEventId)>, limit: usize, ) -> (Vec<(RostraId, ShortEventId)>, Option<(Timestamp, ShortEventId)>)

Paginate through missing content entries.

Returns events sorted by their next scheduled fetch time. Inconsistent rows are omitted; fetcher peeking performs their transactional removal.

Source§

impl Database

Source

pub async fn recalculate_news_post_score( &self, post_id: ExternalEventId, ) -> bool

Source

pub async fn get_random_news_post_ids( &self, limit: usize, ) -> Vec<ExternalEventId>

Source

pub async fn get_social_vote_sum(&self, post_id: ExternalEventId) -> i64

Source

pub async fn get_social_vote( &self, voter: RostraId, post_id: ExternalEventId, ) -> Option<Option<bool>>

Return a voter’s current projected vote for one full post identity.

The outer None means this post is not the winner for its shortened singleton key. The inner None is a retained neutral vote. This query reads the inline current projection and does not require retained source payload bytes.

§Panics

Panics on storage failure or a vote singleton with a missing or invalid inline projection.

Source

pub async fn paginate_news_posts_by_rank_rev( &self, cursor: Option<NewsRankPaginationCursor>, limit: usize, ) -> (Vec<NewsPostRecord<SocialPost>>, Option<NewsRankPaginationCursor>)

Paginate news posts by rank score, newest cursor positions moving from highest score toward lower scores.

Source

pub async fn paginate_news_posts_by_time_rev( &self, cursor: Option<NewsTimePaginationCursor>, limit: usize, ) -> (Vec<NewsPostRecord<SocialPost>>, Option<NewsTimePaginationCursor>)

Paginate news posts by capped creation timestamp, newest first.

Source§

impl Database

Source

pub fn paginate_table<K, V, R>( table: &impl ReadableTable<K, V>, cursor: Option<K>, limit: usize, filter_fn: impl Fn(K, V) -> Result<Option<R>, DbError> + Send + 'static, ) -> Result<(Vec<R>, Option<K>), DbError>
where K: Decode<()> + Encode, V: Decode<()> + Encode,

Source

pub fn paginate_table_rev<K, V, R>( table: &impl ReadableTable<K, V>, cursor: Option<K>, limit: usize, filter_fn: impl Fn(K, V) -> Result<Option<R>, DbError> + Send + 'static, ) -> Result<(Vec<R>, Option<K>), DbError>
where K: Decode<()> + Encode, V: Decode<()> + Encode,

Source

pub fn paginate_table_partition<K, V, C, R>( table: &impl ReadableTable<K, V>, prefix: RangeInclusive<K>, cursor_to_key: impl Fn(C) -> K, cursor: Option<C>, limit: usize, filter_fn: impl Fn(K, V) -> Result<Option<R>, DbError> + Send + 'static, ) -> Result<(Vec<R>, Option<K>), DbError>
where K: Decode<()> + Encode + Ord, V: Decode<()> + Encode,

Source

pub fn paginate_table_partition_rev<K, V, C, R>( table: &impl ReadableTable<K, V>, prefix: RangeInclusive<K>, cursor_to_key: impl Fn(C) -> K, cursor: Option<C>, limit: usize, filter_fn: impl Fn(K, V) -> Result<Option<R>, DbError> + Send + 'static, ) -> Result<(Vec<R>, Option<K>), DbError>
where K: Decode<()> + Encode + Ord, V: Decode<()> + Encode,

Source§

impl Database

Source

pub async fn get_self_followees_snapshot( &self, ) -> Result<Vec<SelfFollowee>, DbError>

Gets all active direct self-follows from one current-state read snapshot.

An unfollow removes the relationship from this snapshot. A later refollow creates a new uninterrupted epoch whose first_ts excludes follows at or before the winning unfollow boundary. Additional follows in the current epoch can move first_ts earlier, while the effective persona selector continues to come from the winning follow event.

Concurrent commits fall wholly before or after the read snapshot; the returned records never combine relationships from different database states. The order of returned records is unspecified.

§Errors

Returns an error on storage or record decode failure.

Source§

impl Database

Source

pub async fn paginate_social_posts( &self, cursor: Option<EventPaginationCursor>, limit: usize, filter_fn: impl Fn(&SocialPostRecord<SocialPost>) -> bool + Send + 'static, ) -> (Vec<SocialPostRecord<SocialPost>>, Option<EventPaginationCursor>)

Source

pub async fn paginate_social_posts_rev( &self, cursor: Option<EventPaginationCursor>, limit: usize, filter_fn: impl Fn(&SocialPostRecord<SocialPost>) -> bool + Send + 'static, ) -> (Vec<SocialPostRecord<SocialPost>>, Option<EventPaginationCursor>)

Source

pub async fn get_latest_social_post_received_at_cursor( &self, ) -> Option<ReceivedAtPaginationCursor>

Get the cursor of the most recently received social post.

Used for tracking “last seen” notification position.

Source

pub async fn paginate_social_posts_by_received_at( &self, cursor: Option<ReceivedAtPaginationCursor>, limit: usize, filter_fn: impl Fn(&SocialPostRecord<SocialPost>) -> bool + Send + 'static, ) -> (Vec<SocialPostRecord<SocialPost>>, Option<ReceivedAtPaginationCursor>)

Paginate social posts ordered by when we received them (forward).

Used for notification badge count calculation.

Source

pub async fn paginate_social_posts_by_received_at_rev( &self, cursor: Option<ReceivedAtPaginationCursor>, limit: usize, filter_fn: impl Fn(&SocialPostRecord<SocialPost>) -> bool + Send + 'static, ) -> (Vec<SocialPostRecord<SocialPost>>, Option<ReceivedAtPaginationCursor>)

Paginate social posts ordered by when we received them (reverse).

Used for notification timeline display.

Source

pub async fn paginate_social_post_comments_rev( &self, post_event_id: ShortEventId, cursor: Option<EventPaginationCursor>, limit: usize, ) -> (Vec<SocialPostRecord<SocialPost>>, Option<EventPaginationCursor>)

Source

pub async fn paginate_social_post_reactions_rev( &self, post_event_id: ShortEventId, cursor: Option<EventPaginationCursor>, limit: usize, ) -> (Vec<SocialPostRecord<SocialPost>>, Option<EventPaginationCursor>)

Source

pub async fn get_posts_by_id( &self, post_ids: impl Iterator<Item = ShortEventId>, ) -> HashMap<ShortEventId, SocialPostRecord<SocialPost>>

Source

pub async fn get_persona_tags_for_id( &self, id: RostraId, ) -> BTreeSet<PersonaTag>

Get all persona tags used by an identity, with usage counts > 0.

Source

pub async fn get_personas_for_id( &self, id: RostraId, ) -> BTreeMap<PersonaId, String>

Source

pub async fn get_personas( &self, iter: impl Iterator<Item = (RostraId, PersonaId)>, ) -> BTreeMap<(RostraId, PersonaId), String>

Source

pub async fn get_social_post( &self, event_id: ShortEventId, ) -> Option<SocialPostRecord<SocialPost>>

Source

pub async fn is_self_mention(&self, event_id: ShortEventId) -> bool

Check if a post is a self-mention (mentions the local user).

Returns true if the post with the given event_id is recorded in the social_posts_self_mention table, meaning it contains an @mention of the local user.

Source

pub async fn get_self_mentions(&self) -> HashSet<ShortEventId>

Get the set of all event IDs that are self-mentions.

Returns a HashSet of ShortEventIds for posts that mention the local user. Used for efficient filtering in notification queries.

Source

pub async fn get_latest_shoutbox_received_at_cursor( &self, ) -> Option<ReceivedAtPaginationCursor>

Get the cursor of the most recently received shoutbox post.

Used for tracking “last seen” shoutbox position.

Source

pub async fn paginate_shoutbox_posts_by_received_at_rev( &self, cursor: Option<ReceivedAtPaginationCursor>, limit: usize, ) -> (Vec<ShoutboxPostRecord>, Option<ReceivedAtPaginationCursor>)

Paginate shoutbox posts ordered by when we received them (reverse - newest first).

Unlike social posts, shoutbox posts are not filtered - all posts are shown.

Source

pub async fn count_shoutbox_posts_since( &self, cursor: Option<ReceivedAtPaginationCursor>, limit: usize, ) -> usize

Count shoutbox posts received after the given cursor.

Used for counting unread shoutbox messages.

Source§

impl Database

Source

pub async fn get_social_post_materialization_tip( &self, ) -> Result<SocialPostMaterializationCursor, DbError>

Gets a cursor at the current tip of the SocialPost materialization feed.

The cursor denotes the next sequence in one read snapshot. Establishing that snapshot is the consumer-enablement linearization point: every occurrence visible before the tip is acknowledged by the cursor, while an occurrence committed after the snapshot has a sequence at or after the cursor and remains discoverable by a later scan. A commit concurrent with this call may fall on either side of that boundary.

This reads only the feed’s last key; it does not enumerate or resolve feed rows. An empty feed returns the sequence-zero cursor.

§Errors

Returns an error on storage, key decode, or sequence overflow.

Source

pub async fn scan_social_post_materializations( &self, after: Option<SocialPostMaterializationCursor>, limit: NonZero<usize>, ) -> Result<SocialPostMaterializationPage, DbError>

Scans ordinary SocialPost materializations in commit order.

after is an opaque position acknowledging every earlier occurrence. None starts at this database lineage’s cutover position zero. The schema upgrade does not backfill posts materialized by older code.

Each logged identity is resolved against one current-state read snapshot. Later deletion, pruning, or replacement yields SocialPostMaterialization::Removed; a currently available post yields SocialPostMaterialization::Present. Log rows remain append-only either way. limit bounds rows resolved, and the implementation performs at most one additional key lookahead to determine snapshot-relative exhaustion.

A replaced post is still required to have a coherent lifecycle. If that lifecycle claims the content remains processed, retained bytes must be present and decodable. Corruption takes precedence over Removed.

§Errors

Returns no page or acknowledgment on storage, decode, cursor, density, or current-state invariant errors.

Source§

impl Database

Source

pub const EVENT_METADATA_SIZE: u64 = 192

Size of event metadata in bytes (Event struct + signature). See rostra_core::event::Event documentation.

Source§

impl Database

Source

pub async fn mk_db_path( data_dir: &Path, self_id: RostraId, ) -> Result<PathBuf, Error>

Source

pub async fn new_in_memory(self_id: RostraId) -> Result<Database, DbError>

Source

pub async fn open( path: impl Into<PathBuf>, self_id: RostraId, ) -> Result<Database, DbError>

Open an identity database, creating it when absent.

Opening storage older than schema version 25 performs the total rebuild before returning. This can hold a long atomic write transaction and requires deployment-specific RAM and temporary disk headroom. See specs/ARCH-client-database.md#total-rebuild.

Source

pub async fn compact(&mut self) -> Result<bool, CompactionError>

Source

pub async fn dump_table(&self, name: &str) -> Result<(), TableDumpError>

Source

pub fn self_followees_subscribe( &self, ) -> CurrentState<Arc<HashMap<RostraId, IdsFolloweesRecord>>>

Subscribe to owned snapshots of the retained current self-followee projection.

Source

pub fn self_followers_subscribe( &self, ) -> CurrentState<Arc<HashMap<RostraId, IdsFollowersRecord>>>

Subscribe to owned snapshots of the retained current self-follower projection.

Source

pub fn self_wot_subscribe(&self) -> CurrentState<Arc<WotData>>

Subscribe to owned snapshots of the retained current Web-of-Trust projection.

Source

pub fn self_head_subscribe(&self) -> CurrentState<Option<ShortEventId>>

Subscribe to owned snapshots of the retained deterministic self-head representative.

The value is the minimum current ShortEventId. It is a stable default, not a claim that the current head set is a singleton. Every committed self-event insertion publishes, even when the representative is unchanged.

Source

pub fn new_content_subscribe(&self) -> Receiver<VerifiedEventContent>

Source

pub fn new_posts_subscribe( &self, ) -> Receiver<(VerifiedEventContent, SocialPost)>

Source

pub fn new_shoutbox_subscribe( &self, ) -> Receiver<(VerifiedEventContent, Shoutbox)>

Source

pub fn new_heads_subscribe(&self) -> Receiver<(RostraId, ShortEventId)>

Subscribe to incremental exact new-head signals.

This lossy channel carries the event that became a head. Consumers that lag must recover from the durable complete head set.

Source

pub fn ids_with_missing_events_subscribe( &self, capacity: usize, ) -> Receiver<RostraId>

Source

pub fn news_score_updates_subscribe( &self, capacity: usize, ) -> Receiver<ExternalEventId>

Source

pub fn content_missing_notify(&self) -> Arc<Notify> ⓘ

Get a handle to the content-missing notification.

The MissingEventContentFetcher calls notified() on this to wake up when new missing content is inserted into the database.

Source

pub async fn has_event(&self, event_id: impl Into<ShortEventId>) -> bool

Source

pub async fn get_missing_events_for_id(&self, id: RostraId) -> Vec<ShortEventId>

Source

pub async fn get_ids_with_missing_events( &self, after: Option<RostraId>, limit: usize, ) -> Vec<RostraId>

Lists unique authors that still have missing event envelopes.

The page starts strictly after after, is ordered by author ID, and contains at most limit authors. A zero limit returns an empty page.

Each call uses an independent read transaction. Callers that reconcile multiple pages should capture Self::get_last_id_with_missing_events first and stop at that high-water author.

This compatibility query panics if the database read fails.

Source

pub async fn get_last_id_with_missing_events(&self) -> Option<RostraId>

Returns the greatest author ID that currently has missing event envelopes.

This compatibility query panics if the database read fails.

Source

pub async fn get_heads_events_for_id(&self, id: RostraId) -> Vec<ShortEventId>

Source

pub async fn get_ids_with_heads( &self, after: Option<RostraId>, limit: usize, ) -> Vec<RostraId>

Lists a bounded ordered page of unique authors with current durable heads.

The page starts strictly after after. A zero limit returns an empty page. This compatibility query panics if the database read fails.

Source

pub async fn count_missing_events_for_id(&self, id: RostraId) -> usize

Source

pub async fn count_heads_events_for_id(&self, id: RostraId) -> usize

Source

pub async fn get_data_usage(&self, id: RostraId) -> IdsDataUsageRecord

Source

pub async fn get_self_followees(&self) -> Vec<(RostraId, PersonasTagsSelector)>

Source

pub async fn get_followees( &self, id: RostraId, ) -> Vec<(RostraId, PersonasTagsSelector)>

Source

pub async fn get_followees_extended( &self, id: RostraId, ) -> (HashMap<RostraId, PersonasTagsSelector>, HashSet<RostraId>)

Source

pub async fn get_self_followers(&self) -> Vec<RostraId>

Source

pub async fn get_followers(&self, id: RostraId) -> Vec<RostraId>

Source

pub async fn get_event( &self, event_id: impl Into<ShortEventId>, ) -> Option<EventRecord>

Source

pub async fn get_event_content( &self, event_id: impl Into<ShortEventId>, ) -> Option<EventContentRaw>

Source

pub async fn get_event_content_state( &self, event_id: impl Into<ShortEventId>, ) -> Option<EventContentState>

Return the lifecycle state for event content that is not currently stored.

For an existing event, None normally means the content was processed. A terminal state such as Deleted, Pruned, or Invalid means callers must not wait for payload availability.

Source

pub async fn get_self_current_head(&self) -> Option<ShortEventId>

Return the minimum current self-head as a deterministic representative.

Use Self::get_heads_self when the complete set is required.

Source

pub async fn get_self_random_eventid(&self) -> Option<ShortEventId>

Source

pub async fn try_process_event( &self, event: &VerifiedEvent, ) -> Result<(InsertEventOutcome, ProcessEventState), DbError>

Fallibly process a verified event envelope.

§Errors

Returns storage and transaction errors, including DbError::IdentityPrefixCollision. An error leaves the ingestion transaction uncommitted.

Source

pub async fn process_event( &self, event: &VerifiedEvent, ) -> (InsertEventOutcome, ProcessEventState)

Process a verified event envelope, panicking on storage failure.

§Panics

Panics after rolling back if storage fails or the event author’s shortened identity prefix is already mapped to a different full identity.

Source

pub async fn try_process_event_with_content( &self, content: &VerifiedEventContent, ) -> Result<(InsertEventOutcome, ProcessEventState), DbError>

Fallibly process a verified envelope and its verified content atomically.

This operation is idempotent whether or not the envelope or content was processed previously.

§Errors

Returns storage and transaction errors, including DbError::IdentityPrefixCollision. An error rolls back the envelope, content, lifecycle, and projection changes together.

Source

pub async fn process_event_with_content( &self, content: &VerifiedEventContent, ) -> (InsertEventOutcome, ProcessEventState)

Process a verified envelope and its verified content, panicking on storage failure.

This operation is idempotent whether or not the envelope or content was processed previously.

§Panics

Panics after rolling back if storage fails or a stored invariant is violated, including a vote winner with a missing or invalid inline projection or a shortened identity prefix mapped to a different full identity.

Source

pub async fn try_process_event_content( &self, event_content: &VerifiedEventContent, ) -> Result<(), DbError>

Fallibly process verified content and its carried envelope atomically.

This is the safe public content-ingestion boundary. If the envelope is absent, it is inserted before content processing in the same transaction. If the envelope is already present, normal lifecycle-state checks make the operation idempotent and prevent repeated accounting or projections.

§Errors

Returns errors under the same conditions as Database::try_process_event_with_content.

Source

pub async fn process_event_content(&self, event_content: &VerifiedEventContent)

Process verified content and its carried envelope, panicking on storage failure.

§Panics

Panics under the same conditions as Database::process_event_with_content.

Source

pub async fn wants_content( &self, event_id: impl Into<ShortEventId>, process_state: ProcessEventState, ) -> bool

Source

pub fn db_init_time(&self) -> Timestamp

Source

pub fn iroh_secret(&self) -> SecretKey

Source§

impl Database

Source

pub async fn extension_write<T>( &self, f: impl FnOnce(&ExtensionWriteTransaction<'_>) -> Result<T, DbError>, ) -> Result<T, DbError>

Runs a serialized transaction over caller-owned extension tables.

The closure cannot access built-in graph, lifecycle, or projection tables. It must not re-enter database writes. This trusted persistence boundary does not include extension data in core replay or convergence; callers own their schema, invariants, and compatibility. Total database migrations preserve extension tables byte-for-byte.

Returning Ok commits all extension-table mutations atomically. Returning Err, panicking, or failing a reserved-name/table operation leaves the transaction uncommitted. Post-commit built-in projection hooks are not available at this boundary.

§Errors

Returns the closure’s error and propagates transaction, table, and commit errors. Opening a reserved table returns DbError::ReservedExtensionTable.

Source

pub async fn extension_read<T>( &self, f: impl FnOnce(&ExtensionReadTransaction<'_>) -> Result<T, DbError>, ) -> Result<T, DbError>

Runs a read transaction over trusted, caller-owned extension tables.

Callers own extension schemas, invariants, and compatibility; core event replay does not validate or rebuild their contents.

§Errors

Returns the closure’s error and propagates transaction and table errors. Opening a reserved table returns DbError::ReservedExtensionTable.

Source

pub async fn get_head(&self, id: RostraId) -> Option<ShortEventId>

Return the minimum current head as a deterministic representative.

Use Self::get_heads when the complete set is required.

Source

pub async fn get_heads(&self, id: RostraId) -> HashSet<ShortEventId>

Return the complete current head set for an identity.

Source

pub async fn get_heads_self(&self) -> HashSet<ShortEventId>

Return the complete current head set for the local identity.

Source

pub async fn get_social_profile( &self, id: RostraId, ) -> Option<IdSocialProfileRecord>

Source

pub async fn get_latest_singleton_event( &self, rostra_id: RostraId, kind: EventKind, aux_key: EventAuxKey, ) -> Option<ShortEventId>

Source

pub async fn get_latest_singleton_events( &self, rostra_id: RostraId, kind: EventKind, ) -> Vec<ShortEventId>

Returns an identity’s singleton winners for one event kind in descending (timestamp, ShortEventId) order.

Source

pub async fn get_id_endpoints( &self, id: RostraId, ) -> BTreeMap<(Timestamp, IrohNodeId), IrohNodeRecord>

Source

pub async fn insert_id_node( &self, id: RostraId, node_id: IrohNodeId, ts: Timestamp, )

Register an iroh node endpoint for an identity.

Useful for test setups where peer node addresses need to be manually registered.

Source

pub async fn get_events_for_id( &self, id: RostraId, limit: usize, ) -> Vec<(EventRecord, Timestamp, Option<EventContentState>)>

Get events for an identity, sorted by timestamp (most recent first).

Returns a vector of (EventRecord, Timestamp, EventContentState option) limited to the specified count.

Source

pub async fn get_known_identities(&self) -> Vec<RostraId>

Get all identities that have authored retained events.

Source

pub async fn get_known_identity( &self, short_id: ShortRostraId, ) -> Option<RostraId>

Resolve a shortened identity that has authored a retained event.

Event ingestion rejects identity-prefix collisions, so a returned identity is unambiguous.

Trait Implementations§

Source§

impl Debug for Database

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<F, I> CastInto<I> for F
where I: CastFrom<F>,

Source§

fn cast_into(self) -> I

Source§

impl<T> CompatExt for T

Source§

fn compat(self) -> Compat<T> ⓘ
where T: Sized,

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T> ⓘ

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T> ⓘ

Applies the Compat adapter by mutable reference. Read more
Source§

impl<F, T> ExpectFrom<F> for T
where T: TryFrom<F>, <T as TryFrom<F>>::Error: Debug,

Source§

fn expect_from(other: F) -> T

Source§

impl<F, I> ExpectInto<I> for F
where I: ExpectFrom<F>,

Source§

fn expect_into(self) -> I

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more