Skip to main content

FileCommand

Enum FileCommand 

Source
pub enum FileCommand {
    Add {
        paths: Vec<PathBuf>,
        secret: bool,
        to: Vec<String>,
        from: Option<String>,
    },
    Checkout {
        file: String,
        path: Option<PathBuf>,
    },
    Where {
        file: String,
    },
    Thumbnail {
        file: String,
        path: PathBuf,
    },
    Thumbnails,
    Pin {
        file: String,
        device: Option<String>,
    },
    Unpin {
        file: String,
        device: Option<String>,
    },
    Checkin {
        copy: String,
        keep: bool,
        force: bool,
    },
}
Expand description

What nib file can do, in the personal space.

Variants§

§

Add

Adds files, and the files in folders.

They are added in the order of their names: each with its name, its content’s type and size, and where it was found, and a photo or a video with when, where and by which camera it was taken. Content that the library holds already is that file, found in one more place; a file found before at the same place, with the same size and modification time, is not read again. In folders, links, hidden files and folders, checkouts, and the library’s own folder are left out. A file that cannot be read is reported, and the others are added all the same; an error of the library ends the command. Each photo, video or other picture gets a thumbnail, if nib reads its format: JPEG, PNG, GIF, WebP, BMP and TIFF.

With –secret, each file becomes a secret file, such as the scan of a passport: sealed for the secrets, so that only the devices that hold them read it, with its name, type and size readable by all, and nothing recorded of where it was found. The original stays where it is, unprotected. The library’s first secret sets up its secrets, with a passphrase of their own.

Fields

§paths: Vec<PathBuf>

The files and folders; with –secret, files only.

§secret: bool

Adds secret files.

§to: Vec<String>

The entity, such as a login, to attach the secret files to; given again, several.

§from: Option<String>

Where the files came from, such as an old phone, a disc or a drive, by a name of yours, such as Mom's old phone: made the first time, and recorded with where each file was found, with its path there from the folder given on.

§

Checkout

Writes a plain copy of a file to open or edit in other apps.

The copy is of the file’s current version, recorded as a checkout on this device: into a folder, under the file’s name, or as a new file; without either, into the current folder. It replaces nothing, and a copy there already, unchanged, stays as it is. Checking in records its edits; a purge of the file’s content deletes it, unless it was edited.

Fields

§file: String

The file, by its ID, a prefix of its ID, or its name.

§path: Option<PathBuf>

The folder, or the path of the copy.

§

Where

Says which disks hold a copy of a file, and how.

A copy is sealed in a store, with when it was last checked, or as a plain copy, where it was found or checked out. Copies count disks, as a copy is lost with its disk. What other devices hold is as their accounts last said, which each gives at its syncs.

Fields

§file: String

The file, by its ID, a prefix of its ID, or its name.

§

Thumbnail

Writes the thumbnail of a file, a JPEG, for scripts and tests.

Not listed beside nib file thumbnails, which most want.

The thumbnail is of the file’s current version, the one every device shows, written into a file. A photo gets its thumbnail from the device that adds it, if that device reads its format; nib reads JPEG, PNG, GIF, WebP, BMP and TIFF.

Fields

§file: String

The file, by its ID, a prefix of its ID, or its name.

§path: PathBuf

Where to write the JPEG, which must not exist yet.

§

Thumbnails

Makes the thumbnails that files lack, from the copies here.

It makes those of the formats nib reads, whichever device added the files: for files added before thumbnails were made. The newest go first, by when a photo was taken, else when it was added.

§

Pin

Pins a file to a device of yours, which keeps it whatever its size.

The device is this one unless –device names another; it keeps the file from its next sync. Pins are yours alone, kept in your personal space.

Fields

§file: String

The file, by its ID, a prefix of its ID, or its name.

§device: Option<String>

The device, by its name or ID, or one copy of the library on it by its ID.

§

Unpin

Unpins a file from a device of yours.

The device is this one unless –device names another; it then keeps the file only while it is among the newest files that fit its size.

Fields

§file: String

The file, by its ID, a prefix of its ID, or its name.

§device: Option<String>

The device, by its name or ID, or one copy of the library on it by its ID.

§

Checkin

Ends a checkout: its copy’s edits become a new version.

The edits of the copy on this device become a new version of the file, sealed into the store, and the copy is deleted. A copy that is gone ends its checkout. Edits of a version that is no longer the file’s own are refused, unless –force records them on top. A new version of a photo gets its own thumbnail.

Fields

§copy: String

The copy, by its path, or the file, if it is checked out in one place.

§keep: bool

Keeps the copy, as a checkout of the new version.

§force: bool

Records the edits of an older version on top of the file’s newer one, which history keeps.

Trait Implementations§

Source§

impl Debug for FileCommand

Source§

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

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

impl FromArgMatches for FileCommand

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 FileCommand

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
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

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

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

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