pub struct RepoBuilder { /* private fields */ }Expand description
Builder for opening a Repo.
Must provide exactly one key source: key(), content_key(), token(),
or identity().
Implementations§
Source§impl RepoBuilder
impl RepoBuilder
Sourcepub fn content_key(self, key: &[u8; 32]) -> Self
pub fn content_key(self, key: &[u8; 32]) -> Self
Set a content key (read-only access to one commit).
Sourcepub fn token(self, token: MachineToken) -> Self
pub fn token(self, token: MachineToken) -> Self
Set a machine token (read-only access + signing identity).
Sourcepub fn identity(self, identity: Identity) -> Self
pub fn identity(self, identity: Identity) -> Self
Set an identity for key unwrapping (CLI path).
The builder will find the manifest, ECIES-unwrap the repo key using the identity’s recipient key, and extract the signing key automatically.
Sourcepub fn signing_key(self, key: SigningKey) -> Self
pub fn signing_key(self, key: SigningKey) -> Self
Set a signing key for commit operations.
Sourcepub fn target_shard_size(self, size: u64) -> Self
pub fn target_shard_size(self, size: u64) -> Self
Override the target shard size (default: from config or 100KB).
Sourcepub fn remote(self, remote: Arc<dyn RemoteStore>) -> Self
pub fn remote(self, remote: Arc<dyn RemoteStore>) -> Self
Set a remote store for push/pull operations.
When set, Repo::push() and Repo::pull() use this remote instead
of creating an IpfsStore from config. Pass a NetworkRemoteStore
wrapping a VoidNode for daemon-backed networking.
Auto Trait Implementations§
impl Freeze for RepoBuilder
impl !RefUnwindSafe for RepoBuilder
impl Send for RepoBuilder
impl Sync for RepoBuilder
impl Unpin for RepoBuilder
impl UnsafeUnpin for RepoBuilder
impl !UnwindSafe for RepoBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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