Skip to main content

Lockbox

Struct Lockbox 

Source
pub struct Lockbox<State = Writable> { /* private fields */ }
Expand description

Open encrypted lockbox container.

A Lockbox owns the encrypted storage backend plus the decrypted metadata needed to make changes. Mutations are staged in memory until commit() is called; reopening a lockbox after an interrupted commit returns the last published state.

Implementations§

Source§

impl Lockbox

Source

pub fn try_to_bytes(&self) -> Result<Vec<u8>, Error>

Source

pub fn commit(&mut self) -> Result<(), Error>

Persist pending lockbox changes atomically to the backing storage.

Returns storage, encoding, or security-limit errors if pending changes cannot be written. On error, in-memory metadata is rolled back to the state before the commit attempt.

Source§

impl<State> Lockbox<State>
where State: Send,

Source

pub fn extract_to_directory( &self, destination: &Path, policy: &ExtractPolicy, ) -> Result<(), Error>

Extract all permitted entries into a destination directory.

Returns Error::Io for host filesystem failures, Error::SecurityLimitExceeded when the extraction policy rejects the destination or size/count limits, and lockbox read errors for corrupt or missing stored entries.

Source§

impl<State> Lockbox<State>

Source

pub fn open_file( &self, path: &LockboxPath, ) -> Result<LockboxFileReader<'_, State>, Error>

Open a seekable read handle over a file inside the lockbox.

Source

pub fn add_file( &mut self, path: &LockboxPath, data: &[u8], replace: bool, ) -> Result<(), Error>
where State: WritableLockboxState,

Add or replace a file from an in-memory byte slice.

When replace is false, returns Error::AlreadyExists if path already names an existing file or symlink. When replace is true, returns Error::NotFound if there is no existing entry to replace. Returns Error::InvalidPath for directory-only or unsafe lockbox paths and propagates storage or encoding errors from the write.

Source

pub fn add_file_with_permissions( &mut self, path: &LockboxPath, data: &[u8], permissions: u32, replace: bool, ) -> Result<(), Error>
where State: WritableLockboxState,

Add or replace a file with explicit Unix-style permissions.

permissions is a Unix mode value containing only the low permission bits, written in Rust as octal literals such as 0o600, 0o640, or 0o755. File type bits, sticky/setuid/setgid bits, and platform ACLs are not supported.

When replace is false, returns Error::AlreadyExists if path already names an existing file or symlink. When replace is true, returns Error::NotFound if there is no existing entry to replace. Returns Error::InvalidPath for directory-only or unsafe lockbox paths, Error::InvalidPath for unsupported permission bits, and propagates storage or encoding errors from the write.

Source

pub fn add_file_from_reader( &mut self, path: &LockboxPath, reader: impl Read, replace: bool, ) -> Result<(), Error>
where State: WritableLockboxState,

Add or replace a file by streaming bytes from a reader.

When replace is false, returns Error::AlreadyExists if path already names an existing file or symlink. When replace is true, returns Error::NotFound if there is no existing entry to replace. Returns Error::InvalidPath for directory-only or unsafe lockbox paths and propagates reader, storage, or encoding errors from the write.

Source

pub fn add_file_from_path( &mut self, source: &Path, destination: &LockboxPath, replace: bool, ) -> Result<(), Error>
where State: WritableLockboxState,

Add or replace a file by reading from a host filesystem path.

When replace is false, returns Error::AlreadyExists if destination already names an existing file or symlink. When replace is true, returns Error::NotFound if there is no existing entry to replace. Returns Error::InvalidPath for directory-only or unsafe destination paths and Error::Io if the host file cannot be read.

Source

pub fn add_file_from_reader_with_permissions( &mut self, path: &LockboxPath, reader: impl Read, permissions: u32, replace: bool, ) -> Result<(), Error>
where State: WritableLockboxState,

Add or replace a streamed file with explicit Unix-style permissions.

permissions is a Unix mode value containing only the low permission bits, written in Rust as octal literals such as 0o600, 0o640, or 0o755. File type bits, sticky/setuid/setgid bits, and platform ACLs are not supported.

When replace is false, returns Error::AlreadyExists if path already names an existing file or symlink. When replace is true, returns Error::NotFound if there is no existing entry to replace. Returns Error::InvalidPath for directory-only or unsafe lockbox paths, Error::InvalidPath for unsupported permission bits, and propagates reader, storage, or encoding errors from the write.

Source

pub fn get_file(&self, path: &LockboxPath) -> Result<Vec<u8>, Error>

Return the complete contents of a file.

Returns Error::InvalidPath for directory-only paths, Error::NotFound if path is absent or not a file, Error::CorruptRecord if stored file metadata is inconsistent, and Error::Io if an internal write into the output buffer fails.

Source

pub fn extract_file_to_writer( &self, path: &LockboxPath, writer: impl Write, ) -> Result<(), Error>

Extract a file’s contents to a writer.

Returns Error::InvalidPath for directory-only paths, Error::NotFound if path is absent or not a file, Error::CorruptRecord if stored file metadata is inconsistent, and Error::Io if the writer fails.

Source

pub fn extract_file_to( &self, source: &LockboxPath, destination: &Path, replace: bool, ) -> Result<(), Error>

Extract a file’s contents to a host filesystem path.

When replace is false, returns Error::AlreadyExists if the destination path already exists. When replace is true, returns Error::NotFound if the destination path does not already exist. Returns Error::Io if the destination file cannot be created. Returns the same errors as extract_file_to_writer for lockbox read failures.

Source

pub fn permissions(&self, path: &LockboxPath) -> Option<u32>

Return stored Unix-style permissions for a file or symlink.

The returned value uses the low Unix permission bits only, for example 0o600, 0o640, or 0o755.

Source

pub fn read_file_range( &self, path: &LockboxPath, offset: u64, len: u64, ) -> Result<Vec<u8>, Error>

Read a bounded byte range from a file.

Returns Error::InvalidPath for directory-only paths, Error::NotFound if path is absent or not a file, and Error::CorruptRecord if stored file metadata is inconsistent. A range outside the file returns an empty vector rather than an error.

Source

pub fn stream_content<F>( &self, options: ContentStreamOptions, visitor: F, ) -> Result<(), Error>
where F: FnMut(ContentChunk, &mut dyn Read) -> Result<(), Error>,

Stream file content ranges without extracting files to the host filesystem.

Source§

impl Lockbox

Source

pub fn open_file_for_write( &mut self, path: &LockboxPath, options: OpenFileOptions, ) -> Result<LockboxFileMut<'_>, Error>

Open a seekable read/write handle over a file inside the lockbox.

Source§

impl<State> Lockbox<State>

Source

pub fn define_form( &mut self, alias: &str, name: &str, fields: Vec<FormFieldDefinition>, ) -> Result<FormDefinition, Error>
where State: WritableLockboxState,

Source

pub fn define_form_with_description( &mut self, alias: &str, name: &str, description: &str, fields: Vec<FormFieldDefinition>, ) -> Result<FormDefinition, Error>
where State: WritableLockboxState,

Source

pub fn define_form_with_type_id( &mut self, type_id: FormTypeId, alias: &str, name: &str, fields: Vec<FormFieldDefinition>, ) -> Result<FormDefinition, Error>
where State: WritableLockboxState,

Source

pub fn define_form_with_type_id_and_description( &mut self, type_id: FormTypeId, alias: &str, name: &str, description: &str, fields: Vec<FormFieldDefinition>, ) -> Result<FormDefinition, Error>
where State: WritableLockboxState,

Source

pub fn revise_form_definition( &mut self, type_id: &FormTypeId, name: &str, description: &str, fields: Vec<FormFieldDefinition>, ) -> Result<FormDefinition, Error>
where State: WritableLockboxState,

Source

pub fn resolve_form_definition( &self, reference: &str, ) -> Result<FormDefinition, Error>

Source

pub fn list_form_definitions(&self) -> Result<Vec<FormDefinition>, Error>

Source

pub fn list_form_definition_revisions( &self, type_id: &FormTypeId, ) -> Result<Vec<FormDefinition>, Error>

Source

pub fn import_form_definition( &mut self, definition: FormDefinition, ) -> Result<FormDefinition, Error>
where State: WritableLockboxState,

Source

pub fn create_form_record( &mut self, path: &LockboxPath, type_reference: &str, name: &str, ) -> Result<FormRecord, Error>
where State: WritableLockboxState,

Source

pub fn get_form_record( &self, path: &LockboxPath, ) -> Result<Option<FormRecord>, Error>

Source

pub fn list_form_records(&self) -> Result<Vec<FormRecord>, Error>

Source

pub fn delete_form_record(&mut self, path: &LockboxPath) -> Result<(), Error>
where State: WritableLockboxState,

Source

pub fn move_form_records( &mut self, moves: &[(LockboxPath, LockboxPath)], ) -> Result<(), Error>
where State: WritableLockboxState,

Move one or more form records while preserving all field values.

The complete move is validated before records are changed. Existing unrelated records are never overwritten.

Source

pub fn set_form_field_normal( &mut self, path: &LockboxPath, field_id: &str, value: &str, ) -> Result<(), Error>
where State: WritableLockboxState,

Source

pub fn set_form_field_secret( &mut self, path: &LockboxPath, field_id: &str, value: &SecureString, ) -> Result<(), Error>
where State: WritableLockboxState,

Source

pub fn set_form_field( &mut self, path: &LockboxPath, field_id: &str, value: FormValue, ) -> Result<(), Error>
where State: WritableLockboxState,

Source

pub fn get_form_field( &self, path: &LockboxPath, field_id: &str, ) -> Result<Option<FormFieldValue>, Error>

Source§

impl Lockbox

Source

pub fn create_in_memory( protection: LockboxProtection<'_>, signing_key: &OwnerSigningKeyPair, ) -> Result<Lockbox, Error>

Create a new in-memory lockbox using the supplied key material.

This is the bytes-oriented counterpart to Lockbox::create_file. Call commit after mutations, then try_to_bytes to serialize the lockbox.

Source

pub fn create_file( path: &Path, protection: LockboxProtection<'_>, signing_key: &OwnerSigningKeyPair, ) -> Result<Lockbox, Error>

Create a new lockbox file using the supplied key material.

Returns Error::Io if the host file cannot be created or written, Error::SecurityLimitExceeded if key material cannot be generated or wrapped, and storage/encoding errors from the initial commit.

Source

pub fn open_bytes( bytes: Vec<u8>, open: LockboxOpen<'_>, ) -> Result<Lockbox<ReadOnly>, Error>

Open an in-memory lockbox using the supplied open key material.

Source

pub fn open_bytes_for_write( bytes: Vec<u8>, open: LockboxOpen<'_>, signing_key: &OwnerSigningKeyPair, ) -> Result<Lockbox, Error>

Open an in-memory lockbox for mutation and attach signing_key for commits.

Source

pub fn open( path: &Path, open: LockboxOpen<'_>, ) -> Result<Lockbox<ReadOnly>, Error>

Open an existing lockbox file using the supplied open key material.

Password and contact opens use only key slots embedded in the lockbox file. This method does not read the local vault, cached content keys, or vault-stored key-directory backups. Use revault_vault_api::Vault when that behavior is required.

Returns Error::Io if the host file cannot be read, Error::InvalidKey when the supplied open material cannot authenticate the content key, or corrupt/truncated errors if the lockbox structure cannot be parsed.

Source

pub fn open_for_write( path: &Path, open: LockboxOpen<'_>, signing_key: &OwnerSigningKeyPair, ) -> Result<Lockbox, Error>

Open a lockbox file for mutation and attach signing_key for commits.

Source

pub fn open_for_write_with_signing_key( path: &Path, open: LockboxOpen<'_>, load_signing_key: impl FnOnce(&Lockbox<ReadOnly>) -> Result<OwnerSigningKeyPair, Error>, ) -> Result<Lockbox, Error>

Open a lockbox file for mutation after loading its owner signing key.

This is for lockboxes that store their own owner signing key, such as the local vault. The callback receives a read-only borrow of the opened lockbox and must return the key that will sign future commits.

Source

pub fn create_with_password(password: &SecureString) -> Result<Lockbox, Error>

Source

pub fn create_with_contact(contact: &ContactPublicKey) -> Result<Lockbox, Error>

Source

pub fn open_with_password( bytes: Vec<u8>, password: &SecureString, ) -> Result<Lockbox, Error>

Source

pub fn open_with_contact( bytes: Vec<u8>, contact: &ContactKeyPair, ) -> Result<Lockbox, Error>

Source

pub fn add_password(&mut self, password: &SecureString) -> Result<u64, Error>

Add another password that can open this lockbox and return its key id.

A password does not encrypt file content directly. The lockbox content key is random; each password wraps that same content key in an embedded key-directory entry. Lockbox::open with LockboxOpen::Password tries each embedded password entry until one unwraps the content key.

Returns Error::Io if random salt generation fails, Error::InvalidInput if internal password-derivation parameters are invalid, Error::InvalidKey if authenticated key wrapping fails, or Error::SecurityLimitExceeded if secure memory access fails.

Source

pub fn add_contact(&mut self, contact: &ContactPublicKey) -> Result<u64, Error>

Add a contact public key to the lockbox and return its key id.

Once a contact’s public key has been added to a lockbox, the matching contact’s private keypair can be used to open the lockbox. Add contacts with their public key, not their private keypair.

To add a contact to the box, you must be able to open the box with your own key.

Returns Error::SecurityLimitExceeded if secure key access or key wrapping fails.

Source

pub fn add_contact_named( &mut self, name: impl Into<String>, contact: &ContactPublicKey, ) -> Result<u64, Error>

Add a contact public key selected by a local name and return its key id.

The name is validated for caller-side label storage, but is not stored in the lockbox. Persisting names would leak who can open a shared lockbox.

Source

pub fn delete_key(&mut self, id: u64) -> Result<(), Error>

Delete a key from the lockbox and compact obsolete key directory pages.

Returns Error::NotFound if id does not exist, Error::SecurityLimitExceeded when attempting to remove the last key, or storage/encoding errors if compaction fails.

Source

pub fn list_key_slots(&self) -> Vec<LockboxKeySlot>

List the keys that can open this lockbox.

Source

pub fn replace_password( &mut self, old_password: &SecureString, new_password: &SecureString, ) -> Result<u64, Error>

Replace one existing password with a new password and return the new key id.

The old password is used only to find a matching embedded password entry. Other passwords and contact keys are left unchanged. Returns Error::InvalidKey if no embedded password entry matches old_password; returns storage or encoding errors if compaction fails after the replacement.

Source

pub fn replace_content_key_with_contacts( &mut self, retained_contacts: &[(String, ContactPublicKey)], ) -> Result<Vec<(String, u64)>, Error>

Replace the lockbox content key and grant access to the supplied contacts.

This is the low-level primitive for true revocation. It rewrites the archive with a fresh content key and creates a new key directory containing only retained_contacts. Password slots and contacts not supplied by the caller are intentionally not preserved.

Source§

impl<State> Lockbox<State>

Source

pub fn list( &self, options: ListOptions, ) -> Result<impl Iterator<Item = Result<LockboxEntry, Error>>, Error>

Return an iterator over entries matching listing options.

Returns Error::InvalidPath if the list root or glob pattern is unsafe. Iteration returns only table-of-contents metadata. It does not read symlink page objects; call get_symlink_target for symlink targets.

Source

pub fn stat(&self, path: &LockboxPath) -> Option<LockboxEntry>

Return metadata for one file, symlink, or directory.

Source

pub fn exists(&self, path: &LockboxPath) -> bool

Return true when path names an existing file, symlink, or directory entry.

Source

pub fn is_dir(&self, path: &LockboxPath) -> bool

Return true when path names an existing directory entry.

Source§

impl<State> Lockbox<State>

Source

pub fn create_dir( &mut self, path: &LockboxPath, create_parents: bool, ) -> Result<(), Error>
where State: WritableLockboxState,

Create a directory entry.

When create_parents is true, missing parent directories are created first. The root directory / is implicit and cannot be created.

Source

pub fn create_parent_dirs_for( &mut self, path: &LockboxPath, ) -> Result<(), Error>
where State: WritableLockboxState,

Source

pub fn remove_dir(&mut self, path: &LockboxPath) -> Result<(), Error>
where State: WritableLockboxState,

Remove an empty directory entry.

Source

pub fn remove_dir_recursive(&mut self, path: &LockboxPath) -> Result<(), Error>
where State: WritableLockboxState,

Remove a directory entry and all descendants.

Source

pub fn set_permissions( &mut self, path: &LockboxPath, permissions: u32, ) -> Result<(), Error>
where State: WritableLockboxState,

Change stored Unix-style permission bits on a file, symlink, or directory.

Source

pub fn delete(&mut self, path: &LockboxPath) -> Result<(), Error>
where State: WritableLockboxState,

Delete a file or symlink from the lockbox.

Returns Error::InvalidPath for directory-only paths, Error::NotFound if path does not name an existing entry, and storage errors if pending data must be flushed before deletion.

Source

pub fn rename( &mut self, from: &LockboxPath, to: &LockboxPath, ) -> Result<(), Error>
where State: WritableLockboxState,

Rename one file/symlink or a directory prefix.

Returns Error::InvalidPath for unsafe file paths, self-nested directory moves, or generated destination paths that are not valid lockbox file paths. Returns Error::NotFound when the source file or directory prefix does not exist. Existing destination entries are replaced by the rename.

Source§

impl<State> Lockbox<State>

Add or replace a symbolic link.

When replace is false, returns Error::AlreadyExists if path already names an existing file or symlink. When replace is true, returns Error::NotFound if there is no existing entry to replace. Returns Error::InvalidPath for directory-only or unsafe lockbox paths and propagates storage errors from the write.

Return the target path for a symbolic link.

Returns Error::InvalidPath for directory-only paths, Error::NotFound if path is absent or not a symlink, and Error::CorruptRecord if the stored symlink metadata is inconsistent.

Return true when the logical path is a symbolic link.

Source§

impl<State> Lockbox<State>

Source

pub fn set_variable( &mut self, name: &VariableName, value: &str, ) -> Result<(), Error>
where State: WritableLockboxState,

Store or replace a non-secret variable.

Returns Error::InvalidInput if the value contains unsupported characters, Error::SecurityLimitExceeded if the value exceeds the configured variable value size limit, Error::InvalidOperation when attempting to overwrite an existing secret variable as non-secret, and Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn set_secret_variable( &mut self, name: &VariableName, value: &SecureString, ) -> Result<(), Error>
where State: WritableLockboxState,

Store or replace a secret variable.

Secret values remain in secure storage. Changing an existing variable between normal and secret sensitivity requires deleting it first.

Returns Error::InvalidInput if the secret plaintext contains unsupported characters, Error::SecurityLimitExceeded if the secret plaintext exceeds the configured variable value size limit, Error::InvalidOperation when attempting to overwrite an existing non-secret variable as secret, and Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn get_variable(&self, name: &VariableName) -> Result<Option<String>, Error>

Return a non-secret variable by name.

Returns Ok(None) when the variable is absent. Returns Error::InvalidOperation if the variable exists but is secret, and Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn with_secret_variable<R>( &self, name: &VariableName, f: impl FnOnce(&SecureString) -> R, ) -> Result<Option<R>, Error>

Access a secret variable within a callback.

The callback receives the SecretString handle. Use SecretString::with_str inside the callback when plaintext access is required.

Returns Ok(None) when the variable is absent. Returns Error::InvalidOperation if the variable exists but is non-secret, and Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn variable_sensitivity( &self, name: &VariableName, ) -> Result<Option<VariableSensitivity>, Error>

Return the sensitivity of a variable, if it exists.

Returns Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn delete_variable(&mut self, name: &VariableName) -> Result<(), Error>
where State: WritableLockboxState,

Delete a variable if it exists.

Returns Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn move_variables( &mut self, moves: &[(VariableName, VariableName)], ) -> Result<(), Error>
where State: WritableLockboxState,

Move one or more variables without exposing or copying their plaintext.

The operation is validated in full before any variable is changed. Sources must exist, destinations must be unique, and a destination may not replace a variable that is not itself being moved.

Source

pub fn list_variables( &self, ) -> Result<Vec<(VariableName, VariableSensitivity)>, Error>

List variable names with their sensitivity.

Returns Error::CorruptRecord if stored variable metadata cannot be loaded.

Source

pub fn visit_variables( &self, f: impl FnMut(&VariableName, VariableValueRef<'_>) -> Result<(), Error>, ) -> Result<(), Error>

Visit every variable.

Normal values are provided as borrowed strings. Secret values are provided as SecretString references so callers must explicitly use the secret type’s scoped accessors.

Returns Error::CorruptRecord if stored variable metadata cannot be loaded, or any error returned by the visitor callback.

Source§

impl Lockbox

Source

pub fn create(key: impl AsRef<[u8]>) -> Lockbox

Source

pub fn create_with_options( key: impl AsRef<[u8]>, options: LockboxOptions, ) -> Lockbox

Source

pub fn create_with_lockbox_id( key: impl AsRef<[u8]>, lockbox_id: LockboxId, ) -> Lockbox

Source

pub fn create_with_lockbox_id_and_options( key: impl AsRef<[u8]>, lockbox_id: LockboxId, options: LockboxOptions, ) -> Lockbox

Source

pub fn open_bytes_with_key( bytes: Vec<u8>, key: impl AsRef<[u8]>, ) -> Result<Lockbox, Error>

Source

pub fn open_bytes_with_key_options( bytes: Vec<u8>, key: impl AsRef<[u8]>, options: LockboxOptions, ) -> Result<Lockbox, Error>

Source§

impl Lockbox

Source

pub fn inspect_file( path: impl AsRef<Path>, ) -> Result<LockboxFileInspection, Error>

Inspect public lockbox metadata without decrypting stored contents.

This reads the lockbox header and key directory only. It does not open file contents and does not require a password, contact private key, or cached content key.

Source§

impl<State> Lockbox<State>

Source

pub fn lockbox_id(&self) -> LockboxId

Return the stable id embedded in this lockbox.

Source

pub fn owner_inspection(&self) -> Result<LockboxOwnerInspection, Error>

Return verified owner-signing metadata for this opened lockbox.

Source

pub fn set_owner_signing_key(&mut self, keypair: OwnerSigningKeyPair)
where State: WritableLockboxState,

Source

pub fn set_workload_profile(&mut self, profile: WorkloadProfile)

Set cache behavior tuned for the caller’s expected access pattern.

Source

pub fn workload_profile(&self) -> WorkloadProfile

Return the currently selected workload profile.

Source

pub fn set_worker_policy(&mut self, policy: WorkerPolicy)

Set the worker policy used for native page/frame preparation.

Source

pub fn worker_policy(&self) -> WorkerPolicy

Return the currently selected worker policy.

Source

pub fn reset_import_stats(&self)

Reset import diagnostic counters.

Source

pub fn import_stats(&self) -> ImportStats

Return cumulative import diagnostic counters for this handle.

Source

pub fn inspector(&self) -> LockboxInspector<'_, State>

Return a read-only diagnostics view for this lockbox.

Trait Implementations§

Source§

impl<State> Debug for Lockbox<State>
where State: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<State = Writable> !Freeze for Lockbox<State>

§

impl<State = Writable> !RefUnwindSafe for Lockbox<State>

§

impl<State = Writable> !Sync for Lockbox<State>

§

impl<State> Send for Lockbox<State>
where State: Send,

§

impl<State> Unpin for Lockbox<State>
where State: Unpin,

§

impl<State> UnsafeUnpin for Lockbox<State>

§

impl<State> UnwindSafe for Lockbox<State>
where State: UnwindSafe,

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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