pub enum DeviceCommand {
Pair {
ai_agent: Option<String>,
phone: bool,
spaces: Vec<String>,
give_secrets: bool,
port: Port,
},
List,
Revoke {
device: String,
yes: bool,
codes: bool,
},
Mark {
device: String,
archive: bool,
everyday: bool,
away: bool,
home: bool,
keeps: Option<Keeps>,
waits: Option<Waits>,
new_spaces: Option<NewSpacesArg>,
},
Review,
Accept {
device: String,
yes: bool,
},
}Expand description
What nib device can do.
Variants§
Pair
Adds another device of yours, or an AI agent’s copy of the library.
It shows a code to give to nib init –join on the device, which then gets a copy of the library. The code works for ten minutes, three wrong tries end it, and both devices must be on the same network. A computer gets every space of this device’s, and takes the spaces made later; a phone, with –phone, gets your personal space alone, and asks before it takes a space made later. The new device gets no secrets, but with –give-secrets.
Fields
ai_agent: Option<String>Adds a copy of the library for an AI agent instead, named after it, such as
Claude, which nib mcp serves it: it gets no secrets, and may not purge, add or
revoke devices, or change the library’s own records, such as types and storage
policies. Run nib init –join where nib mcp will run.
phone: boolAdds a phone: it gets your personal space alone, or the spaces given with –in, and asks before it takes a space made later, with nib space take there.
spaces: Vec<String>A space besides your personal one that the new device gets, by its name or the start of its ID, instead of the default, every space for a computer and none for a phone; give it once for each. For an AI agent, a space that it may read and write too: a shared space must allow AI agents, which its admins say with nib space ai-agents; an admin’s device allows them here at once. Pair the AI agent anew to change its spaces.
List
Lists your devices: the copies of the library on them.
Each copy is kept by an app; those revoked are listed too, with how many of their changes wait for review.
Revoke
Revokes a device of yours, such as a lost phone.
It revokes every copy of the library on the device, or one copy by its ID: no device syncs with it any more, what it changed that this device does not have is set aside for review, and the library gets a new key that it does not get. Revoking is final. Without –yes, it says what it would revoke, and revokes nothing.
Fields
Mark
Marks a device as an archive node or everyday, at home or away.
An archive node, such as a NAS or a desktop, keeps the files that policies assign it, or as an everyday device, as every device is until marked; and as kept away from home, such as a relative’s NAS, or at home. Copies on an archive node, and away from home, count where a policy asks for them. Your devices tell the others at their next syncs. Without a mark, it says how the device is marked.
Fields
keeps: Option<Keeps>How many bytes of files it keeps as an everyday device, such as 20GB: the files
pinned to it, then the newest and those opened lately, while some device is an
archive node; default for a tenth of its disk, or nothing on a phone.
waits: Option<Waits>How many days it waits as an archive node, from 1 to 365, before it destroys what a
purge destroys, during which nib purges there can stop the purge; none for not at
all, default for 30. A shorter wait, or none, holds only once the wait before it
has passed, so that no infected device can shorten it and purge at once.
new_spaces: Option<NewSpacesArg>Whether nib’s copy of the library on this device takes the spaces made later on your other devices, as a computer does, or asks first, as a phone does, with nib space take: said only on the device itself, so that no other device can say it for it, and by each app’s copy for itself.
Review
Lists the changes of revoked devices that were set aside.
They were set aside as no device that revoked them had them; so are those of devices nobody added.
Accept
Accepts every change of a device that was set aside.
They count after all, with their own times. Changes that say who may write to the library, such as one that revokes another device, are never accepted. Without –yes, it says how many it would accept.
Trait Implementations§
Source§impl Debug for DeviceCommand
impl Debug for DeviceCommand
Source§impl FromArgMatches for DeviceCommand
impl FromArgMatches for DeviceCommand
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 DeviceCommand
impl Subcommand for DeviceCommand
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 DeviceCommand
impl Freeze for DeviceCommand
impl Move for DeviceCommand
impl RefUnwindSafe for DeviceCommand
impl Send for DeviceCommand
impl Sync for DeviceCommand
impl Unpin for DeviceCommand
impl UnsafeUnpin for DeviceCommand
impl UnwindSafe for DeviceCommand
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.