Struct btlib::BlockOpenOptions

source ·
pub struct BlockOpenOptions<T, C> { /* private fields */ }
Expand description

Describes how to open a block, including the inner stream from which the block can be read and the credentials to use to open it.

Implementations§

source§

impl BlockOpenOptions<(), ()>

source

pub fn new() -> BlockOpenOptions<(), ()>

Creates a new empty BlockOpenOptions.

source§

impl<T, C> BlockOpenOptions<T, C>

source

pub fn with_inner<U>(self, inner: U) -> BlockOpenOptions<U, C>

Configures the given stream to be used for reading and writing the block.

source

pub fn with_creds<D>(self, creds: D) -> BlockOpenOptions<T, D>

Configures the given Creds to be used to open the block.

source

pub fn with_encrypt(self, encrypt: bool) -> Self

Specifies whether or not the block contents will be encrypted.

source

pub fn with_block_path(self, block_path: BlockPath) -> Self

Specifies the path of the block. If the block is new, this will be the path it’s created at. If an existing block is being opened, then this is used for validating the block.

source

pub fn with_parent_key(self, parent_key: Option<SymKey>) -> Self

Configures the given parent key to be used for unlocking the block key.

source§

impl<T: ReadAt + WriteAt + Size + Sectored + 'static, C: Creds + 'static> BlockOpenOptions<T, C>

source

pub fn open_bare(self) -> Result<ConcreteBlock<T, C>>

Opens the block without wrapping it in an Accessor.

source

pub fn open(self) -> Result<Accessor<ConcreteBlock<T, C>>>

Opens the block and wraps it in an Accessor before returning it.

Trait Implementations§

source§

impl Default for BlockOpenOptions<(), ()>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T, C> RefUnwindSafe for BlockOpenOptions<T, C>where C: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, C> Send for BlockOpenOptions<T, C>where C: Send, T: Send,

§

impl<T, C> Sync for BlockOpenOptions<T, C>where C: Sync, T: Sync,

§

impl<T, C> Unpin for BlockOpenOptions<T, C>where C: Unpin, T: Unpin,

§

impl<T, C> UnwindSafe for BlockOpenOptions<T, C>where C: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Free for T

§

unsafe default fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.