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
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
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.
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
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
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
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.
Trait Implementations§
Source§impl Debug for FileCommand
impl Debug for FileCommand
Source§impl FromArgMatches for FileCommand
impl FromArgMatches for FileCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for FileCommand
impl Subcommand for FileCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Forget for FileCommand
impl Freeze for FileCommand
impl Move for FileCommand
impl RefUnwindSafe for FileCommand
impl Send for FileCommand
impl Sync for FileCommand
impl Unpin for FileCommand
impl UnsafeUnpin for FileCommand
impl UnwindSafe for FileCommand
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.