Enum iroh_blobs::cli::BlobCommands

source ·
pub enum BlobCommands {
    Add {
        source: BlobSource,
        options: BlobAddOptions,
    },
    Get {
        ticket: TicketOrHash,
        address: Vec<SocketAddr>,
        relay_url: Option<RelayUrl>,
        recursive: Option<bool>,
        override_addresses: bool,
        node: Option<PublicKey>,
        out: Option<OutputTarget>,
        stable: bool,
        tag: Option<String>,
        queued: bool,
    },
    Export {
        hash: Hash,
        out: OutputTarget,
        recursive: bool,
        stable: bool,
    },
    List(ListCommands),
    Validate {
        verbose: u8,
        repair: bool,
    },
    ConsistencyCheck {
        verbose: u8,
        repair: bool,
    },
    Delete(DeleteCommands),
    Share {
        hash: Hash,
        addr_options: AddrInfoOptions,
        recursive: bool,
        debug: bool,
    },
}
Available on crate feature cli only.
Expand description

Subcommands for the blob command.

Variants§

§

Add

Add data from PATH to the running node.

Fields

§source: BlobSource

Path to a file or folder.

If set to STDIN, the data will be read from stdin.

§

Get

Download data to the running node’s database and provide it.

In addition to downloading the data, you can also specify an optional output directory where the data will be exported to after it has been downloaded.

Fields

§ticket: TicketOrHash

Ticket or Hash to use.

§address: Vec<SocketAddr>

Additional socket address to use to contact the node. Can be used multiple times.

§relay_url: Option<RelayUrl>

Override the relay URL to use to contact the node.

§recursive: Option<bool>

Override to treat the blob as a raw blob or a hash sequence.

§override_addresses: bool

If set, the ticket’s direct addresses will not be used.

§node: Option<PublicKey>

NodeId of the provider.

§out: Option<OutputTarget>

Directory or file in which to save the file(s).

If set to STDOUT the output will be redirected to stdout.

If not specified, the data will only be stored internally.

§stable: bool

If set, the data will be moved to the output directory, and iroh will assume that it will not change.

§tag: Option<String>

Tag to tag the data with.

§queued: bool

If set, will queue the download in the download queue.

Use this if you are doing many downloads in parallel and want to limit the number of downloads running concurrently.

§

Export

Export a blob from the internal blob store to the local filesystem.

Fields

§hash: Hash

The hash to export.

§out: OutputTarget

Directory or file in which to save the file(s).

If set to STDOUT the output will be redirected to stdout.

§recursive: bool

Set to true if the hash refers to a collection and you want to export all children of the collection.

§stable: bool

If set, the data will be moved to the output directory, and iroh will assume that it will not change.

§

List(ListCommands)

List available content on the node.

§

Validate

Validate hashes on the running node.

Fields

§verbose: u8

Verbosity level.

§repair: bool

Repair the store by removing invalid data

Caution: this will remove data to make the store consistent, even if the data might be salvageable. E.g. for an entry for which the outboard data is missing, the entry will be removed, even if the data is complete.

§

ConsistencyCheck

Perform a database consistency check on the running node.

Fields

§verbose: u8

Verbosity level.

§repair: bool

Repair the store by removing invalid data

Caution: this will remove data to make the store consistent, even if the data might be salvageable. E.g. for an entry for which the outboard data is missing, the entry will be removed, even if the data is complete.

§

Delete(DeleteCommands)

Delete content on the node.

§

Share

Get a ticket to share this blob.

Fields

§hash: Hash

Hash of the blob to share.

§addr_options: AddrInfoOptions

Options to configure the address information in the generated ticket.

Use relay-and-addresses in networks with no internet connectivity.

§recursive: bool

If the blob is a collection, the requester will also fetch the listed blobs.

§debug: bool

Display the contents of this ticket too.

Implementations§

source§

impl BlobCommands

source

pub async fn run(self, blobs: &Client, addr: NodeAddr) -> Result<()>

Runs the blob command given the iroh client.

Trait Implementations§

source§

impl Clone for BlobCommands

source§

fn clone(&self) -> BlobCommands

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for BlobCommands

source§

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

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for BlobCommands

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Subcommand for BlobCommands

source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

§

type Output = T

Should always be Self
source§

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

§

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, U> TryFrom<U> for T
where 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 T
where 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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
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
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T