pub struct System { /* private fields */ }Expand description
The real world: the operating system’s randomness, clock and keystore, and the terminal.
Implementations§
Trait Implementations§
Source§impl Environment for System
impl Environment for System
Source§fn offset_minutes(&self) -> i32
fn offset_minutes(&self) -> i32
The device’s offset from UTC, in minutes, at the current time.
Source§fn time_zone(&self) -> TimeZone
fn time_zone(&self) -> TimeZone
The device’s time zone, by which times are read and shown: a fixed offset from UTC,
Environment::offset_minutes, unless the environment knows the zone’s rules.Source§fn passphrase(&mut self, prompt: &str) -> Result<Zeroizing<String>>
fn passphrase(&mut self, prompt: &str) -> Result<Zeroizing<String>>
Asks the person for a passphrase. Read more
Source§fn passphrase_params(&self) -> PassphraseParams
fn passphrase_params(&self) -> PassphraseParams
How much work deriving a key from a new passphrase takes.
Source§fn computer_name(&self) -> String
fn computer_name(&self) -> String
The computer’s name, the default name of a device.
Source§fn account(&self) -> Account
fn account(&self) -> Account
The person’s account on this computer, after which a new library’s user is named.
Source§fn current_dir(&self) -> Result<PathBuf>
fn current_dir(&self) -> Result<PathBuf>
The current folder:
nib init makes it a library, and the other commands look for
their library in it and in the folders it is in. Read moreSource§fn default_library(&self) -> Option<PathBuf>
fn default_library(&self) -> Option<PathBuf>
The folder of the library that commands work in outside every library’s folder, if
the person names one:
NIBKEEP_LIBRARY.Source§fn ceiling(&self) -> Option<PathBuf>
fn ceiling(&self) -> Option<PathBuf>
A folder in which, and above which, commands do not look for their library, as
Git’s
GIT_CEILING_DIRECTORIES says: tests keep to their own folders with it, and the
end-to-end tests name it in NIBKEEP_CEILING.Source§fn keystore(&mut self) -> bool
fn keystore(&mut self) -> bool
Whether the platform has a keystore to keep a library’s keys in, connecting to it
the first time.
Source§fn downloads(&self) -> Option<PathBuf>
fn downloads(&self) -> Option<PathBuf>
This device’s downloads folder, as the platform names it, if it has one.
Source§fn state_folder(&self) -> Option<PathBuf>
fn state_folder(&self) -> Option<PathBuf>
This computer’s folder of NibKeep’s state, where the list of libraries synced from
login is (technical design):
None
where there is none.Source§fn login_entry(&self) -> Option<LoginEntry>
fn login_entry(&self) -> Option<LoginEntry>
The login entry that starts
nibkeep-sync, where the platform has one.Source§fn open_firewall(&mut self) -> Firewall
fn open_firewall(&mut self) -> Firewall
Lets the person’s other devices reach this computer through its firewall, where
nib does that, as on Windows, asking for the administrator’s consent.Source§fn sync_program(&self) -> Option<PathBuf>
fn sync_program(&self) -> Option<PathBuf>
The copy of
nibkeep-sync installed beside nib, if there is one.Source§fn nib_program(&self) -> Option<PathBuf>
fn nib_program(&self) -> Option<PathBuf>
The program of
nib itself, which AI clients run as a library’s server.Source§fn ai_client(&self, program: &str) -> Option<Command>
fn ai_client(&self, program: &str) -> Option<Command>
A command of the AI client’s program
program, such as claude, if it is installed
here, to tell the client of a server or take it away: none unless the environment
finds it.Source§fn can_ask(&self) -> bool
fn can_ask(&self) -> bool
Whether
Environment::ask has someone to ask, as before showing a code that would
be spent without an answer.Source§fn ask(&mut self, question: &str) -> Result<Option<String>>
fn ask(&mut self, question: &str) -> Result<Option<String>>
Asks the person a question on the terminal, and returns the answer, or
None if
there is no terminal to ask on, as for a script or an AI agent. Read moreSource§fn clipboard(&mut self) -> Result<Box<dyn Board>, ClipboardError>
fn clipboard(&mut self) -> Result<Box<dyn Board>, ClipboardError>
The clipboard, to copy secrets to: none, unless the environment has one. Read more
Source§fn interruptible(&mut self)
fn interruptible(&mut self)
Makes an interruption, as with Ctrl+C, end the next wait rather than
nib, from now
on: before nib copies a secret, so that an interruption never leaves it on the
clipboard.Source§fn stop_on_interrupt(&mut self, stop: Arc<AtomicBool>)
fn stop_on_interrupt(&mut self, stop: Arc<AtomicBool>)
Makes an interruption, as with Ctrl+C, set
stop rather than end nib: for a
command that runs until stopped, and lets go of what it holds as it ends.Source§fn wait(&mut self, duration: Duration) -> bool
fn wait(&mut self, duration: Duration) -> bool
Waits for
duration, or until the person interrupts nib, as with Ctrl+C, whichever
comes first. Returns whether the person interrupted it.Source§fn languages(&self) -> Vec<String>
fn languages(&self) -> Vec<String>
The languages the system is set to, first the one it uses, as the platform names
them, such as
en_US.UTF-8 or en-US.Source§fn note(&mut self, line: &str)
fn note(&mut self, line: &str)
Tells the person something beside what the command writes: on standard error, so
that output that other programs read stays as it is.
Source§fn git(&self) -> Command
fn git(&self) -> Command
The person’s own Git, with their settings and credentials, as a command to give
arguments to (technical design).
Auto Trait Implementations§
impl !Sync for System
impl Forget for System
impl Freeze for System
impl Move for System
impl RefUnwindSafe for System
impl Send for System
impl Unpin for System
impl UnsafeUnpin for System
impl UnwindSafe for System
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
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>
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>
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)
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)
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.