Skip to main content

Database

Struct Database 

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

Implementations§

Source§

impl Database

Source

pub async fn export_data(&self, exported_at: String) -> Result<AvenExport>

Source

pub async fn validate_import_data(&self, export: &AvenExport) -> Result<()>

Source

pub async fn import_data(&self, export: &AvenExport) -> Result<IntegrityReport>

Source

pub async fn database_integrity_report(&self) -> Result<IntegrityReport>

Source

pub async fn attachment_integrity_checks( &self, blob_dir: &Path, deep: bool, ) -> Result<Vec<IntegrityCheck>>

Source

pub async fn create_backup_archive( &self, blob_dir: &Path, output: &Path, ) -> Result<()>

Source§

impl Database

Source

pub fn latest_schema_version() -> Option<i64>

Source

pub async fn inspect(path: &Path) -> InspectedDatabase

Copies an existing SQLite file and its sidecars into isolated temporary storage, then opens the isolated snapshot for diagnostic queries.

This path does not create parent directories, databases, sidecars, metadata, workspaces, journal settings, or migrations in user state.

Source§

impl Database

Source

pub async fn open(path: &Path) -> Result<Self>

Source

pub fn path(&self) -> &Path

Source

pub async fn close(&self)

Closes every connection, including those held by clones, and waits until SQLite has released the files. Dropping a database closes its connections in the background instead, so delete or replace the files only after this returns.

Source

pub async fn meta(&self, key: &str) -> Result<Option<String>>

Source

pub async fn conflict_exists( &self, workspace_id: &WorkspaceId, task_id: &TaskId, field: &str, ) -> Result<bool>

Source§

impl Database

Source

pub async fn label_usage( &self, workspace_id: &WorkspaceId, ) -> Result<Vec<LabelUsage>>

Source

pub async fn list_labels( &self, workspace_id: &WorkspaceId, search: Option<&str>, ) -> Result<Vec<String>>

Source

pub async fn resolve_labels( &self, workspace_id: &WorkspaceId, labels: &[String], ) -> Result<Vec<String>>

Source§

impl Database

Source

pub async fn sync_access_refusal(&self) -> Result<Option<SyncAccessRefusal>>

Returns the last time this installation’s sync credentials were refused.

Source

pub async fn record_sync_access_refusal(&self) -> Result<SyncAccessRefusal>

Remembers an authentication refusal until a later sync succeeds.

Source

pub async fn clear_sync_access_refusal(&self) -> Result<()>

Clears a previous authentication refusal after a successful sync.

Source

pub async fn restore_queue_workspace(&self) -> Result<Workspace>

Source

pub async fn select_queue_workspace( &self, workspace_id: &WorkspaceId, ) -> Result<Workspace>

Source

pub async fn onboarding_status(&self) -> Result<OnboardingStatus>

Source

pub async fn complete_onboarding(&self) -> Result<()>

Source§

impl Database

Source

pub async fn collapsed_sidebar_sections( &self, ) -> Result<BTreeSet<SidebarSection>>

Source

pub async fn set_sidebar_section_collapsed( &self, section: SidebarSection, collapsed: bool, ) -> Result<()>

Source§

impl Database

Source

pub async fn list_metadata_fields( &self, workspace_id: &WorkspaceId, ) -> Result<Vec<MetadataFieldUsage>>

Source

pub async fn find_metadata_field( &self, workspace_id: &WorkspaceId, key: &str, ) -> Result<Option<MetadataField>>

Source

pub async fn rename_metadata_field( &self, workspace: &Workspace, key: &str, new_key: &str, ) -> Result<MetadataField>

Source§

impl Database

Source

pub async fn task_metadata( &self, workspace_id: &WorkspaceId, task_id: &TaskId, ) -> Result<Vec<TaskMetadataValue>>

Source§

impl Database

Source

pub async fn set_task_status( &self, workspace: &Workspace, task: &Task, status: &str, ) -> Result<Task>

Source

pub async fn set_task_priority( &self, workspace: &Workspace, task: &Task, priority: &str, ) -> Result<Task>

Source

pub async fn cycle_task_priority( &self, workspace: &Workspace, task: &Task, reverse: bool, ) -> Result<Task>

Source

pub async fn set_task_deleted_state( &self, workspace: &Workspace, task: &Task, deleted: bool, ) -> Result<Task>

Source

pub async fn set_task_field( &self, workspace: &Workspace, task_id: &TaskId, field: &str, value: &str, ) -> Result<bool>

Source

pub async fn set_task_project( &self, workspace: &Workspace, task_id: &TaskId, project: &Project, ) -> Result<bool>

Source

pub async fn set_task_fields( &self, workspace: &Workspace, updates: &[(TaskId, String, String)], ) -> Result<Vec<bool>>

Source

pub async fn cycle_task_priorities( &self, workspace: &Workspace, tasks: &[Task], reverse: bool, ) -> Result<Vec<Task>>

Source§

impl Database

Source

pub async fn add_task_attachment( &self, workspace: &Workspace, blob_dir: &Path, policy: LifecyclePolicy, task_id: &TaskId, input: AttachmentAddInput, ) -> Result<AttachmentAddOutcome>

Source

pub async fn add_ordered_task_attachment( &self, workspace: &Workspace, blob_dir: &Path, policy: LifecyclePolicy, task_id: &TaskId, created_at: String, input: TaskAttachmentAddInput, ) -> Result<AttachmentAddOutcome>

Source

pub async fn attachment_by_id( &self, workspace: &Workspace, attachment_id: &str, ) -> Result<AttachmentOutcome>

Source

pub async fn delete_task_attachment( &self, workspace: &Workspace, attachment_id: &str, ) -> Result<AttachmentOutcome>

Source

pub async fn attachment_read_items_by_task( &self, blob_dir: &Path, workspace_id: &WorkspaceId, task_id: &TaskId, include_deleted: bool, ) -> Result<Vec<AttachmentReadItem>>

Reports inventory availability, downgraded to unavailable when the object file is absent from blob_dir.

Source

pub async fn prune_attachments( &self, blob_dir: &Path, policy: LifecyclePolicy, apply: bool, ) -> Result<PruneSummary>

Source

pub async fn acquire_attachment_lease( &self, sha256: &str, purpose: &str, ) -> Result<String>

Source

pub async fn acquire_live_attachment_read_lease( &self, workspace: &Workspace, attachment_id: &str, ) -> Result<AttachmentReadLease>

Source

pub async fn release_attachment_lease(&self, lease_id: &str) -> Result<()>

Source

pub async fn attachment_lifecycle_report( &self, blob_dir: &Path, policy: LifecyclePolicy, ) -> Result<LifecycleReport>

Source§

impl Database

Source

pub async fn list_conflicts( &self, workspace: &Workspace, project_key: Option<&str>, field: Option<&str>, ) -> Result<Vec<ConflictListItem>>

Source

pub async fn task_conflicts( &self, workspace: &Workspace, task_id: &TaskId, field: Option<&str>, ) -> Result<Vec<ConflictDetail>>

Source

pub async fn unresolved_task_conflict_fields( &self, workspace_id: &WorkspaceId, candidates: &[(TaskId, String)], ) -> Result<HashMap<TaskId, HashSet<String>>>

Source

pub async fn conflict_variant_value( &self, workspace: &Workspace, task_id: &TaskId, field: &str, token: &str, ) -> Result<String>

Source

pub async fn resolve_conflict_with_tui_undo( &self, workspace: &Workspace, task_id: &TaskId, field: &str, value: &str, ) -> Result<ConflictResolutionOutcome>

Source

pub async fn resolve_conflict( &self, workspace: &Workspace, task_id: &TaskId, field: &str, value: &str, ) -> Result<ConflictOutcome>

Source

pub async fn recurrence_series_conflicts( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, field: Option<&str>, ) -> Result<Vec<ConflictDetail>>

Source

pub async fn recurrence_conflict_variant_value( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, field: &str, token: &str, ) -> Result<String>

Source

pub async fn resolve_recurrence_conflict( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, field: &str, value: &str, ) -> Result<String>

Source§

impl Database

Source

pub async fn add_task_dependency( &self, workspace: &Workspace, task_id: &TaskId, depends_on_id: &TaskId, ) -> Result<DependencyOutcome>

Source

pub async fn add_task_dependency_with_undo( &self, workspace: &Workspace, task_id: &TaskId, depends_on_id: &TaskId, undo: UndoContext, ) -> Result<DependencyOutcome>

Source

pub async fn remove_task_dependency( &self, workspace: &Workspace, task_id: &TaskId, depends_on_id: &TaskId, ) -> Result<DependencyOutcome>

Source

pub async fn remove_task_dependency_with_undo( &self, workspace: &Workspace, task_id: &TaskId, depends_on_id: &TaskId, undo: UndoContext, ) -> Result<DependencyOutcome>

Source§

impl Database

Source

pub async fn add_task_to_epic( &self, workspace: &Workspace, child_id: &TaskId, epic_id: &TaskId, ) -> Result<EpicLinkOutcome>

Source

pub async fn add_task_to_epic_with_undo( &self, workspace: &Workspace, child_id: &TaskId, epic_id: &TaskId, undo: UndoContext, ) -> Result<EpicLinkOutcome>

Source

pub async fn remove_task_from_epic( &self, workspace: &Workspace, child_id: &TaskId, epic_id: &TaskId, ) -> Result<EpicLinkOutcome>

Source

pub async fn remove_task_from_epic_with_undo( &self, workspace: &Workspace, child_id: &TaskId, epic_id: &TaskId, undo: UndoContext, ) -> Result<EpicLinkOutcome>

Source§

impl Database

Source

pub async fn create_label( &self, workspace: &Workspace, name: &str, ) -> Result<LabelOutcome>

Source

pub async fn create_label_with_tui_undo( &self, workspace: &Workspace, name: &str, ) -> Result<LabelOutcome>

Source

pub async fn delete_label( &self, workspace: &Workspace, name: &str, ) -> Result<LabelDeleteOutcome>

Source

pub async fn delete_label_with_tui_undo( &self, workspace: &Workspace, name: &str, ) -> Result<LabelDeleteOutcome>

Source

pub async fn rename_label_with_tui_undo( &self, workspace: &Workspace, name: &str, new_name: &str, ) -> Result<LabelRenameOutcome>

Source§

impl Database

Source

pub async fn create_project( &self, workspace: &Workspace, name: &str, ) -> Result<ProjectOutcome>

Source

pub async fn create_project_with_tui_undo( &self, workspace: &Workspace, name: &str, ) -> Result<ProjectOutcome>

Source

pub async fn delete_project( &self, workspace: &Workspace, project: &str, ) -> Result<ProjectDeleteOutcome>

Source

pub async fn rename_project( &self, workspace: &Workspace, project: &str, new_name: &str, prefix: Option<&str>, ) -> Result<ProjectRenameOutcome>

Source

pub async fn rename_project_with_tui_undo( &self, workspace: &Workspace, project: &str, new_name: &str, prefix: Option<&str>, ) -> Result<ProjectRenameOutcome>

Source

pub async fn rename_project_before_commit<T, F>( &self, workspace: &Workspace, project: &str, new_name: &str, prefix: Option<&str>, before_commit: F, ) -> Result<(ProjectRenameOutcome, T)>

Source§

impl Database

Source

pub async fn create_recurrence_series( &self, workspace: &Workspace, params: CreateRecurrenceSeriesParams, ) -> Result<RecurrenceCreateOutcome>

Source

pub async fn update_recurrence_template( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, params: UpdateRecurrenceTemplateParams, ) -> Result<RecurrenceTemplateUpdateOutcome>

Source

pub async fn reconcile_recurrence_series( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, at: DateTime<Utc>, ) -> Result<RecurrenceReconcileOutcome>

Source

pub async fn resolve_recurrence_occurrence( &self, workspace: &Workspace, task_id: &TaskId, outcome: RecurrenceOutcome, ) -> Result<RecurrenceResolveOutcome>

Source

pub async fn resolve_recurrence_occurrence_with_undo( &self, workspace: &Workspace, task_id: &TaskId, outcome: RecurrenceOutcome, undo: UndoContext, ) -> Result<RecurrenceResolveOutcome>

Source

pub async fn pause_recurrence_series( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, ) -> Result<RecurrenceStateOutcome>

Source

pub async fn resume_recurrence_series( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, at: DateTime<Utc>, ) -> Result<RecurrenceStateOutcome>

Source

pub async fn stop_recurrence_series( &self, workspace: &Workspace, series_id: &RecurrenceSeriesId, skip_current: bool, ) -> Result<RecurrenceStateOutcome>

Source

pub async fn resolve_recurrence_ref( &self, workspace: &Workspace, input: &str, ) -> Result<RecurrenceSeries>

Source

pub async fn recurrence_series_ref( &self, workspace_id: &WorkspaceId, series_id: &RecurrenceSeriesId, ) -> Result<String>

Source§

impl Database

Source§

impl Database

Source

pub async fn move_tasks( &self, source_workspace: &Workspace, input: MoveTasksInput, ) -> Result<MoveTasksOutcome>

Source§

impl Database

Source

pub async fn create_task_with_attachments( &self, workspace: &Workspace, blob_dir: &Path, lifecycle_policy: LifecyclePolicy, draft: TaskDraft, attachments: Vec<TaskAttachmentAddInput>, ) -> Result<TaskOutcome>

Source

pub async fn create_task_with_attachments_and_undo( &self, workspace: &Workspace, blob_dir: &Path, lifecycle_policy: LifecyclePolicy, draft: TaskDraft, attachments: Vec<TaskAttachmentAddInput>, undo: TaskCreationUndo, ) -> Result<TaskOutcome>

Source

pub async fn create_task_with_attachments_and_options( &self, workspace: &Workspace, blob_dir: &Path, lifecycle_policy: LifecyclePolicy, draft: TaskDraft, attachments: Vec<TaskAttachmentAddInput>, options: TaskCreationOptions, ) -> Result<TaskOutcome>

Source

pub async fn create_task_with_attachments_for_epic( &self, workspace: &Workspace, blob_dir: &Path, lifecycle_policy: LifecyclePolicy, draft: TaskDraft, attachments: Vec<TaskAttachmentAddInput>, epic_id: &TaskId, ) -> Result<TaskOutcome>

Source

pub async fn create_task_with_attachments_for_epic_and_undo( &self, workspace: &Workspace, blob_dir: &Path, lifecycle_policy: LifecyclePolicy, draft: TaskDraft, attachments: Vec<TaskAttachmentAddInput>, options: TaskCreationOptions, ) -> Result<TaskOutcome>

Source§

impl Database

Source

pub async fn create_task( &self, workspace: &Workspace, draft: TaskDraft, ) -> Result<TaskOutcome>

Source

pub async fn create_task_with_undo( &self, workspace: &Workspace, draft: TaskDraft, undo: TaskCreationUndo, ) -> Result<TaskOutcome>

Source

pub async fn create_task_with_options( &self, workspace: &Workspace, draft: TaskDraft, options: TaskCreationOptions, ) -> Result<TaskOutcome>

Source

pub async fn create_task_for_epic( &self, workspace: &Workspace, draft: TaskDraft, epic_id: &TaskId, ) -> Result<TaskOutcome>

Source

pub async fn create_task_for_epic_with_undo( &self, workspace: &Workspace, draft: TaskDraft, epic_id: &TaskId, undo: TaskCreationUndo, ) -> Result<TaskOutcome>

Source§

impl Database

Source

pub async fn update_task( &self, workspace: &Workspace, task_id: &TaskId, update: TaskUpdate, ) -> Result<TaskUpdateOutcome>

Source

pub async fn update_tasks( &self, workspace: &Workspace, updates: Vec<(TaskId, TaskUpdate)>, ) -> Result<Vec<TaskUpdateOutcome>>

Source

pub async fn mutate_tasks( &self, workspace: &Workspace, updates: Vec<(TaskId, TaskUpdate)>, undo: UndoContext, ) -> Result<TaskMutationReport>

Source

pub async fn set_task_deleted( &self, workspace: &Workspace, task_id: &TaskId, deleted: bool, ) -> Result<TaskOutcome>

Source§

impl Database

Source

pub async fn add_note( &self, workspace: &Workspace, task_id: &TaskId, body: String, ) -> Result<NoteOutcome>

Source

pub async fn add_note_with_tui_undo( &self, workspace: &Workspace, task_id: &TaskId, body: String, ) -> Result<NoteOutcome>

Source

pub async fn edit_note( &self, workspace: &Workspace, task_id: &TaskId, note_id: &str, body: String, ) -> Result<NoteEditOutcome>

Source

pub async fn edit_note_with_tui_undo( &self, workspace: &Workspace, task_id: &TaskId, note_id: &str, body: String, ) -> Result<NoteEditOutcome>

Source

pub async fn delete_note( &self, workspace: &Workspace, task_id: &TaskId, note_id: &str, ) -> Result<NoteDeleteOutcome>

Source

pub async fn delete_note_with_tui_undo( &self, workspace: &Workspace, task_id: &TaskId, note_id: &str, ) -> Result<NoteDeleteOutcome>

Source§

impl Database

Source

pub async fn find_project( &self, workspace_id: &WorkspaceId, input: &str, ) -> Result<Option<Project>>

Source

pub async fn find_project_by_id( &self, workspace_id: &WorkspaceId, project_id: &ProjectId, ) -> Result<Option<Project>>

Source

pub async fn resolve_existing_project( &self, workspace_id: &WorkspaceId, project: &str, ) -> Result<Project>

Source

pub async fn list_projects( &self, workspace_id: &WorkspaceId, search: Option<&str>, ) -> Result<Vec<Project>>

Source

pub async fn inferred_project_key_for_add( &self, workspace_id: &WorkspaceId, config_candidate: Option<&str>, cwd: &Path, git_root: Option<&Path>, ) -> Result<Option<String>>

Source

pub async fn inferred_existing_project_key( &self, workspace_id: &WorkspaceId, config_candidate: Option<&str>, cwd: &Path, git_root: Option<&Path>, ) -> Result<Option<String>>

Source

pub async fn remove_project_path( &self, workspace_id: &WorkspaceId, project_id: &ProjectId, path: &Path, ) -> Result<()>

Source

pub async fn resolve_or_create_project( &self, workspace_id: &WorkspaceId, project: &str, ) -> Result<Project>

Source

pub async fn resolve_project_for_stored_value( &self, workspace_id: &WorkspaceId, value: &str, ) -> Result<Project>

Source§

impl Database

Source

pub async fn reconcile_recurrence_reports_at( &self, workspace_id: &WorkspaceId, at: DateTime<Utc>, ) -> Result<RecurrenceReconciliation>

Reconciles recurrence projections before a report reads current state.

The candidate count is bounded. Each changed series writes one atomic projection transaction that can archive one superseded task and materialize one successor.

Source

pub async fn reconcile_recurrence_reports( &self, workspace_id: &WorkspaceId, ) -> Result<RecurrenceReconciliation>

Source

pub async fn list_recurrence_series_view_at( &self, workspace_id: &WorkspaceId, at: DateTime<Utc>, query: RecurrenceSeriesListQuery, ) -> Result<Vec<RecurrenceSeriesListItem>>

Source

pub async fn list_recurrence_series_view( &self, workspace_id: &WorkspaceId, query: RecurrenceSeriesListQuery, ) -> Result<Vec<RecurrenceSeriesListItem>>

Source

pub async fn list_recurrence_series_at( &self, workspace_id: &WorkspaceId, at: DateTime<Utc>, ) -> Result<Vec<RecurrenceSeriesSummary>>

Source

pub async fn recurrence_series_detail_at( &self, workspace_id: &WorkspaceId, series_id: &RecurrenceSeriesId, at: DateTime<Utc>, ) -> Result<RecurrenceSeriesDetail>

Source

pub async fn recurrence_history_at( &self, workspace_id: &WorkspaceId, series_id: &RecurrenceSeriesId, at: DateTime<Utc>, offset: usize, limit: usize, ) -> Result<RecurrenceHistoryPage>

Source

pub async fn list_recurrence_series( &self, workspace_id: &WorkspaceId, ) -> Result<Vec<RecurrenceSeriesSummary>>

Source

pub async fn recurrence_series_detail( &self, workspace_id: &WorkspaceId, series_id: &RecurrenceSeriesId, ) -> Result<RecurrenceSeriesDetail>

Source

pub async fn recurrence_history( &self, workspace_id: &WorkspaceId, series_id: &RecurrenceSeriesId, offset: usize, limit: usize, ) -> Result<RecurrenceHistoryPage>

Source

pub async fn list_project_items( &self, workspace_id: &WorkspaceId, ) -> Result<Vec<ProjectListItem>>

Source

pub async fn list_task_items( &self, workspace_id: &WorkspaceId, filters: TaskFilters, mode: TaskQueryMode, sort: TaskSort, direction: SortDirection, ) -> Result<Vec<TaskListItem>>

Source

pub async fn list_bulk_update_task_items( &self, workspace_id: &WorkspaceId, filters: TaskFilters, mode: TaskQueryMode, sort: TaskSort, direction: SortDirection, ) -> Result<Vec<TaskListItem>>

Source

pub async fn list_task_items_without_activity_from_current_projection( &self, workspace_id: &WorkspaceId, filters: TaskFilters, mode: TaskQueryMode, sort: TaskSort, direction: SortDirection, ) -> Result<Vec<TaskListItem>>

Source

pub async fn list_task_summary_items( &self, workspace_id: &WorkspaceId, filters: TaskFilters, mode: TaskQueryMode, sort: TaskSort, direction: SortDirection, limit: Option<usize>, ) -> Result<Vec<TaskListItem>>

Source

pub async fn sidebar_counts_for_scope( &self, workspace_id: &WorkspaceId, project_key: Option<&str>, ) -> Result<SidebarCounts>

Source

pub async fn list_recent_actions( &self, workspace_id: &WorkspaceId, project_scope: Option<&str>, ) -> Result<Vec<RecentActionItem>>

Source

pub async fn task_activity_for_task( &self, workspace_id: &WorkspaceId, task_id: &TaskId, ) -> Result<Vec<RecentActionItem>>

Source

pub async fn search_task_items( &self, workspace_id: &WorkspaceId, query: TaskSearchQuery, ) -> Result<Vec<TaskSearchResult>>

Source

pub async fn search_task_occurrence_items( &self, workspace_id: &WorkspaceId, query: TaskSearchQuery, ) -> Result<Vec<TaskSearchResult>>

Source

pub async fn search_task_preview_set( &self, workspace_id: &WorkspaceId, query: TaskSearchQuery, ) -> Result<TaskSearchPreviewResultSet>

Source

pub async fn task_detail(&self, task: &Task) -> Result<TaskDetail>

Source

pub async fn task_detail_with_display_refs( &self, task: &Task, display_refs: &DisplayRefContext, ) -> Result<TaskDetail>

Source

pub async fn conflict_display_value( &self, workspace_id: &WorkspaceId, field: &str, value: &str, ) -> Result<String>

Source

pub async fn task_dependency_summary( &self, workspace_id: &WorkspaceId, task_id: &TaskId, ) -> Result<TaskDependencySummary>

Source

pub async fn workspace_task_counts( &self, workspace_id: &WorkspaceId, ) -> Result<WorkspaceTaskCounts>

Source

pub async fn unresolved_conflict_count(&self) -> Result<i64>

Source

pub async fn unresolved_task_conflict_count_in_workspace( &self, workspace_id: &WorkspaceId, ) -> Result<i64>

Source

pub async fn sync_history_stats(&self) -> Result<SyncHistoryStats>

Source

pub async fn database_stats( &self, workspace: &Workspace, ) -> Result<DatabaseStats>

Source§

impl Database

Source

pub async fn display_ref_context( &self, workspace_id: &WorkspaceId, ) -> Result<DisplayRefContext>

Source

pub async fn display_refs_for_task_ids( &self, workspace_id: &WorkspaceId, task_ids: &[TaskId], ) -> Result<HashMap<TaskId, String>>

Source

pub async fn resolve_task_ref( &self, workspace: &Workspace, input: &str, ) -> Result<Task>

Source§

impl Database

Source

pub async fn missing_sync_attachment_counts(&self) -> Result<ByteCount>

Accepted attachments whose image bytes are missing on this device.

Source

pub async fn missing_setup_attachment_counts( &self, blob_dir: &Path, ) -> Result<ByteCount>

Live setup images whose object file is absent, regardless of the inventory’s last-known availability bit.

Source§

impl Database

Source

pub async fn publish_bootstrap( &self, auth: &Authentication<'_>, request: PublishBootstrap<'_>, policy: PublicationPolicy, ) -> Result<PublicationOutcome>

Atomically publishes one complete immutable candidate and signed successor. This does not adopt the seed, install a client, or enable encrypted tail sync.

Source§

impl Database

Source

pub async fn declare_bootstrap_staging( &self, auth: &Authentication<'_>, descriptor: &[u8], budget: Budget, ) -> Result<StagingStatus>

Authenticated declaration also ensures the initial staging reservation. Descriptor and budgets are immutable. Expired retries resume retained bytes.

Source

pub async fn bootstrap_staging_status( &self, auth: &Authentication<'_>, bootstrap_id: [u8; 32], ) -> Result<Status>

Read-only, including for missing/expired candidates. No reservation renewal. Callers compare the returned commitment with their frozen local descriptor. Missing is an observation, never a terminal cancellation fence.

Source

pub async fn ensure_bootstrap_staging( &self, auth: &Authentication<'_>, bootstrap_id: [u8; 32], descriptor_commitment: [u8; 32], ) -> Result<StagingStatus>

Source

pub async fn cancel_bootstrap_staging( &self, auth: &Authentication<'_>, bootstrap_id: [u8; 32], ) -> Result<Status>

Terminal even before declaration. Canceled IDs consume the finite lifetime candidate budget and are never silently forgotten or reopened. Publication wins return its immutable outcome instead, without deleting any data.

Source

pub async fn put_bootstrap_chunk( &self, auth: &Authentication<'_>, request: PutChunk<'_>, ) -> Result<()>

Stores one slot only after checking it against the frozen descriptor. Rejected bytes leave storage unchanged; exact retries succeed, including requests delayed across expiry and resume.

Source

pub async fn put_bootstrap_batch( &self, auth: &Authentication<'_>, request: PutBatch<'_>, ) -> Result<()>

Stores every record of the batch in one transaction, each checked against its slot in the frozen descriptor, or stores nothing. Records already held must match exactly, so an exact retry succeeds and any conflicting record rolls back the whole batch.

Source§

impl Database

Source

pub async fn publish_device_label( &self, device: [u8; 32], label: &str, ) -> Result<()>

Publishes this installation’s automatic label once. Device labels are display metadata; the membership device ID remains the identity.

Source

pub async fn device_labels(&self) -> Result<BTreeMap<[u8; 32], String>>

Reads effective labels from encrypted retained history. Callers pair these with verified membership, so removed devices are not displayed.

Source§

impl Database

Source

pub async fn encrypted_image_downloads_remaining(&self) -> Result<u64>

Images whose bytes this device still has to download. Counting reads only local state and never consumes a selection turn.

Source

pub async fn prepare_encrypted_image_download( &self, a: &Authority, ) -> Result<Option<Download>>

Selects and advances past one pending object before transfer. The local cursor orders attempts, not acceptance, validation or content progress.

Source

pub async fn install_encrypted_image( &self, a: &Authority, blob_dir: &Path, download: &Download, records: &[Vec<u8>], policy: LifecyclePolicy, ) -> Result<()>

Source

pub async fn complete_encrypted_image_from_local( &self, a: &Authority, blob_dir: &Path, download: &Download, policy: LifecyclePolicy, ) -> Result<bool>

Source§

impl Database

Source§

impl Database

Source

pub async fn repair_encrypted_image( &self, a: &Authority, blob_dir: &Path, workspace: &str, reference: &str, ) -> Result<Upload>

Exact targeted repair uses only an authenticated admitted mapping.

Source§

impl Database

Source

pub async fn prune_encrypted_images( &self, grace: Duration, limit: usize, ) -> Result<usize>

Deletes the stored bytes of at most limit images that have been unreferenced and unticketed for at least grace, keeping their descriptors. Returns how many images were pruned.

Source

pub async fn encrypted_image_exchange( &self, context: &Context, bearer: &Secret, op: Operation, policy: LifecyclePolicy, ) -> Result<Reply>

Source§

impl Database

Source

pub async fn encrypted_round_state( &self, authority: &Authority, ) -> Result<RoundState>

One validated read of local round state. Observation never freezes work or advances the download selector.

Source

pub async fn encrypted_tail_observed_rank(&self) -> Result<u64>

Highest tail rank this replica applied or accepted. An honest allocator mark is never below a rank it assigned.

Source

pub async fn prepare_encrypted_push( &self, authority: &Authority, blob_dir: &Path, ) -> Result<Option<Push>>

Returns the frozen head, or freezes the next ordered pending change. Image heads also return exact staged ciphertext for upload.

Source

pub async fn prepare_encrypted_batch_in_run( &self, authority: &Authority, blob_dir: &Path, preflight: Option<Preflight>, count: usize, ) -> Result<(Option<Push>, Option<Preflight>)>

Freezes the next ordered pending group in one serialized push run. Reuses only the checked window while the local mutation sequence is unchanged.

Source

pub async fn reconcile_encrypted_tail_absence( &self, authority: &Authority, absence: &AbsentOperation, blob_dir: &Path, ) -> Result<bool>

Closed-generation absence and replacement commit under one outbox/history owner. A failed transaction retains old bytes and requires a new lookup on retry.

Source

pub async fn reconcile_encrypted_tail_absences( &self, authority: &Authority, absences: &[AbsentOperation], blob_dir: &Path, ) -> Result<bool>

Source

pub async fn observe_encrypted_tail( &self, authority: &Authority, mapping: &Mapping, ) -> Result<Vec<u8>>

Retain an observed immutable outcome before fetching a different representation.

Source

pub async fn verify_encrypted_tail_outcome( &self, authority: &Authority, accepted: &Accepted, ) -> Result<()>

Source

pub async fn encrypted_tail_has_batch_work( &self, authority: &Authority, ) -> Result<bool>

Source

pub async fn encrypted_tail_frozen_records( &self, authority: &Authority, ) -> Result<Vec<(String, Vec<u8>)>>

Returns the immutable unresolved inventory in dispatch order.

Source

pub async fn accept_encrypted_tail_batch( &self, authority: &Authority, mappings: &[Mapping], ) -> Result<()>

Accepts exact frozen ciphertext together with every local domain effect.

Source

pub async fn apply_encrypted_tail_page( &self, authority: &Authority, page: &Page, ) -> Result<()>

Source§

impl Database

Source

pub async fn encrypted_tail_exchange( &self, context: &Context, bearer: &Secret, op: Operation, ) -> Result<Reply>

Source

pub async fn encrypted_tail_batch_exchange( &self, context: &Context, bearer: &Secret, op: BatchOperation, ) -> Result<BatchReply>

Source§

impl Database

Source

pub async fn sync_persistence_status(&self) -> Result<SyncPersistenceStatus>

Local sync bookkeeping; reads no protected keys and contacts no server.

Source§

impl Database

Source

pub async fn prepare_membership_management( &self, auth: &Authentication<'_>, ) -> Result<ManagementPreparation>

Source

pub async fn apply_membership_management( &self, auth: &Authentication<'_>, record: &[u8], ) -> Result<Vec<u8>>

Source§

impl Database

Source

pub async fn verify_membership_history(&self) -> Result<()>

Replays the complete stored membership history and fills the cache. Servers run this before accepting requests; storage without published membership has nothing to verify.

Source

pub async fn membership_evidence( &self, auth: &Authentication<'_>, ) -> Result<Evidence>

This read alone accepts a verified ancestor head, after current credential authentication.

Source

pub async fn register_membership_invitation_at( &self, auth: &Authentication<'_>, raw: &[u8], time: i64, ) -> Result<RegistrationStatus>

Source

pub async fn post_membership_request_at( &self, vault: [u8; 32], handle: [u8; 32], request: &[u8], time: i64, ) -> Result<()>

Source

pub async fn membership_mailbox( &self, vault: [u8; 32], handle: [u8; 32], ) -> Result<Mailbox>

Source

pub async fn cancel_membership_invitation_at( &self, auth: &Authentication<'_>, handle: [u8; 32], time: i64, ) -> Result<CancelStatus>

Terminally fences a registered, unadmitted invitation of the caller so no new admission can commit. Serialized with admission; idempotent. Unknown handles allocate nothing.

Source

pub async fn admit_membership_device_at( &self, auth: &Authentication<'_>, handle: [u8; 32], record: &[u8], time: i64, ) -> Result<Vec<u8>>

Source§

impl Database

Source

pub async fn membership_checkpoint_mirror( &self, ) -> Result<Option<([u8; 32], u64, [u8; 32], [u8; 32])>>

Source

pub async fn mirror_membership_checkpoint( &self, identity: [u8; 32], m: &Membership, evidence: [u8; 32], ) -> Result<()>

Source§

impl Database

Source

pub async fn peer_target_preflight(&self) -> Result<String>

Source

pub async fn peer_retry_preflight( &self, identity: [u8; 32], client: &str, guard: &InstallationGuard, ) -> Result<()>

Rechecks that this pinned peer join is unfinished: nothing installed, associated or set up, and the domain still empty. The enrollment pin and installation fence stay in place.

Source

pub async fn enrollment_pin(&self) -> Result<Option<([u8; 32], String, String)>>

Source

pub async fn pin_enrollment( &self, identity: [u8; 32], client: &str, role: &str, guard: &InstallationGuard, ) -> Result<()>

Source

pub async fn adopted_enrollment_client(&self) -> Result<String>

Source

pub async fn enrollment_artifact(&self, kind: &str) -> Result<Option<Vec<u8>>>

Source

pub async fn enrollment_artifacts(&self) -> Result<HashMap<String, Vec<u8>>>

Source

pub async fn enrollment_artifact_marker(&self) -> Result<i64>

Monotonic, nonsecret marker for write-once enrollment state changes.

Source

pub async fn pin_enrollment_artifact( &self, identity: [u8; 32], kind: &str, digest: [u8; 32], ) -> Result<()>

Source§

impl Database

Source

pub async fn admit_seed_claim( &self, request: &[u8], authentication: ClaimAuthentication<'_>, ) -> Result<ClaimResult>

Admits one immutable sequence-zero claim under operator setup authority. The storage’s unexpired issued verifier is read in this claim transaction, so a concurrent reissue either precedes the claim or finds the storage claimed. Exact authenticated retries return the original result without reissuance. This does not authorize uploads, READY, or ordinary plaintext sync.

Source

pub async fn e2ee_server_is_claimed(&self) -> Result<bool>

Whether encrypted server storage already has its immutable seed claim.

Source

pub async fn local_seed_genesis_commitment(&self) -> Result<Option<[u8; 32]>>

Nonsecret loss-detection pin. This is never a substitute for host authority.

Source

pub async fn pin_local_seed_genesis(&self, genesis: &Genesis) -> Result<()>

Hosts call this only after protected storage has committed exact authority. An old or replaced database may acquire a pin but cannot change one.

Source

pub async fn mark_local_seed_claim_refused(&self, reason: &str) -> Result<()>

Records that a server refused this unfenced provisional claim. Refusals are unauthenticated, so the seed authority stays for an exact retry; hosts present the database as not set up until the next claim attempt.

Source

pub async fn clear_local_seed_claim_refused(&self) -> Result<()>

Source

pub async fn local_seed_claim_refused(&self) -> Result<bool>

Source

pub async fn rollback_local_seed_genesis( &self, expected: [u8; 32], ) -> Result<()>

Removes an abandoned provisional seed pin and its recorded refusal. Once source authority or publication state exists, the installation is fenced and this operation refuses to undo it.

Source

pub async fn issue_e2ee_server_setup( &self, secret: &Secret, fresh_id: [u8; 32], expires_at: u64, ) -> Result<[u8; 32]>

Issues operator setup authority for secret on encrypted server storage and returns its setup ID. An existing ID is kept, even after expiry, so a device whose genesis already binds it can claim with the reissued secret; the replaced verifier refuses earlier secrets. Claimed storage and storage holding local domain data cannot take a new verifier.

Source

pub async fn e2ee_server_setup( &self, now: u64, ) -> Result<Option<SetupAuthority>>

The configured setup verifier while it is unexpired at now (Unix seconds).

Source

pub async fn is_e2ee_server_storage(&self) -> Result<bool>

True once storage was prepared for, or claimed by, an encrypted vault. Refuses marked server storage containing local domain data.

Source

pub async fn has_change_history(&self) -> Result<bool>

True when storage holds change rows. Encrypted server storage never does, so server launch refuses such storage as unsupported.

Source§

impl Database

Source

pub async fn seed_source_pin(&self) -> Result<Option<Vec<u8>>>

Source

pub async fn bind_seed_source( &self, source: &SeedSourceAuthority, installation: &InstallationGuard, ) -> Result<()>

Called under the installation interlock after protected persistence.

Source

pub async fn seed_publication_intent_bytes( &self, ) -> Result<Option<(Vec<u8>, String)>>

Source

pub async fn prepare_seed_publication_intent( &self, source: &SeedSourceAuthority, seed: &SeedAuthority, key: &LocalSharedStatePackageKey, ) -> Result<SeedPublicationIntent>

Commits cancellation exclusion before any protected intent is exposed. Retrying returns exact persisted bytes, never a newly signed context.

Source

pub async fn seal_seed_publication_intent( &self, source: &SeedSourceAuthority, intent: &SeedPublicationIntent, ) -> Result<()>

Hosts supply an intent reloaded from protected storage, never a boolean.

Source

pub async fn cleanup_adopted_seed_capture( &self, source: &SeedSourceAuthority, intent: &SeedPublicationIntent, ) -> Result<()>

Separate post-commit cleanup. Durable authority/receipt never cascades away.

Source§

impl Database

Source

pub async fn has_local_shared_state_package_never_dispatched( &self, ) -> Result<bool>

Reports frozen package ownership, including missing-byte corruption. A true result requires the host to load existing protected authority, never generate a replacement key.

Source

pub async fn package_local_shared_state_never_dispatched( &self, blob_dir: &Path, context: LocalSharedStatePackageContext, key: &LocalSharedStatePackageKey, membership_predecessor: [u8; 32], ) -> Result<EncryptedLocalSharedStatePackage>

Encrypts the durable never-dispatched capture or returns its frozen package.

The first successful call freezes the descriptor, catalogs and encrypted records in one SQLite transaction under the capture candidate ID. Tentative preparation before that commit can be retried. Later calls authenticate and return the exact saved bytes without reading image files. membership_predecessor is context only, not proof of authorization. Changed keys/context, incomplete data and incompatible local-only packages fail without replacement. Cancellation releases bytes and ownership together. SQLite commit/reopen is not a claim of platform power-loss durability.

Source

pub async fn decrypt_and_install_local_shared_state_package( &self, package: &EncryptedLocalSharedStatePackage, key: &LocalSharedStatePackageKey, ) -> Result<SharedStateInstallReport>

Authenticates, decrypts, validates, and atomically installs a package.

All package bytes are checked before the target database transaction is opened. Installation still enforces the existing empty-target boundary.

Source§

impl Database

Source

pub async fn published_snapshot_read( &self, auth: &Authentication<'_>, descriptor: [u8; 32], component: Option<Component>, index: u64, ) -> Result<Vec<u8>>

Copies one published record inside the current-membership transaction. Image bytes are read from lifecycle ownership, never staging or restored.

Source

pub async fn peer_snapshot_receipt( &self, verified: &VerifiedEnrollment, enrollment: [u8; 32], client: &str, guard: &InstallationGuard, ) -> Result<Option<SharedStateInstallReport>>

Receipt lookup still requires independently verified protected authority. It never repairs a receipt or resets a later cursor or domain edit.

Source

pub async fn install_peer_snapshot( &self, verified: &VerifiedEnrollment, enrollment: [u8; 32], client: &str, guard: &InstallationGuard, package: &Metadata, ) -> Result<SharedStateInstallReport>

Authenticated metadata and mappings commit independently of image bytes.

Source§

impl Database

Source

pub async fn capture_local_shared_state_never_dispatched( &self, ) -> Result<NeverDispatchedLocalSharedCapture>

Creates or resumes the one durable, never-dispatched local capture.

The snapshot, exact history map, stable candidate and stream identities, image classification, ownership pins, counter floor, and sync fence commit in one immediate transaction. An existing capture is resumed without reading current domain rows or attachment bytes again.

Source

pub async fn capture_local_shared_state_for_setup( &self, blob_dir: &Path, ) -> Result<NeverDispatchedLocalSharedCapture>

Captures setup state while checking that inventory marked available is still present on disk. Files missing at this boundary are published as unavailable; other filesystem failures remain explicit errors.

Source

pub async fn resume_local_shared_state_never_dispatched( &self, ) -> Result<Option<NeverDispatchedLocalSharedCapture>>

Reopens the durable local capture without consulting newer domain rows.

Source

pub async fn cancel_local_shared_state_never_dispatched( &self, candidate_id: &str, ) -> Result<bool>

Cancels only the given candidate’s never-dispatched capture and releases its pins.

Repeating cancellation after success is harmless. A different active candidate fails closed. Domain rows and later edits are never removed.

Source

pub async fn install_shared_state( &self, capture: &SharedStateCapture, ) -> Result<SharedStateInstallReport>

Atomically installs captured shared state into a fresh database.

The target keeps its own client identity and local settings. Retained history receives dense effective prefix ranks, while source ordering provenance remains separate. Attachment metadata is installed without claiming that image bytes are locally available.

Source§

impl Database

Source

pub async fn task_field_value( &self, workspace_id: &WorkspaceId, task_id: &TaskId, field: &str, ) -> Result<String>

Source

pub async fn task_labels( &self, workspace_id: &WorkspaceId, task_id: &TaskId, ) -> Result<Vec<String>>

Source

pub async fn task_undo_snapshot( &self, workspace_id: &WorkspaceId, task_id: &TaskId, ) -> Result<TaskUndoSnapshot>

Source

pub async fn conflict_row_id( &self, workspace_id: &WorkspaceId, task_id: &TaskId, field: &str, ) -> Result<i64>

Source

pub async fn clear_pending_tui_undo_entries(&self) -> Result<()>

Source

pub async fn latest_tui_undo_presentation( &self, workspace_id: &WorkspaceId, ) -> Result<Option<PendingUndoPresentation>>

Source

pub async fn apply_latest_tui_undo( &self, workspace_id: &WorkspaceId, ) -> Result<Option<UndoOutcome>>

Source§

impl Database

Source

pub async fn list_workspaces(&self) -> Result<Vec<Workspace>>

Source

pub async fn list_workspace_open_summaries( &self, ) -> Result<Vec<WorkspaceOpenSummary>>

Source

pub async fn find_workspace( &self, name_or_key: &str, ) -> Result<Option<Workspace>>

Source

pub async fn workspace_for_id( &self, workspace_id: &WorkspaceId, ) -> Result<Workspace>

Source

pub async fn resolve_workspace(&self, name_or_key: &str) -> Result<Workspace>

Source

pub async fn resolve_required_workspace( &self, name_or_key: &str, source: &str, ) -> Result<Workspace>

Source

pub async fn create_workspace(&self, name: &str) -> Result<Workspace>

Source

pub async fn rename_workspace( &self, workspace_ref: &str, new_name: &str, ) -> Result<Workspace>

Trait Implementations§

Source§

impl Clone for Database

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
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> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
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<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