Skip to main content

Layout

Struct Layout 

Source
pub struct Layout { /* private fields */ }
Expand description

The paths of one SCV instance.

Implementations§

Source§

impl Layout

Source

pub fn new(home: impl Into<PathBuf>) -> Self

The instance at home, selected explicitly as SCV_HOME selects one.

Source

pub fn from_env() -> Result<Self>

The instance selected by SCV_HOME, or ~/.scv, with its home resolved: canonical when it exists, otherwise made absolute. Service unit names and delegation records hash this path, so every process of an instance must resolve it the same way.

Source

pub fn home(&self) -> &Path

Source

pub fn is_default(&self) -> bool

Whether this is the default instance, which SCV_HOME did not select.

Source

pub fn service_name(&self) -> String

The instance’s systemd user unit: scv.service for the default instance, otherwise scv-<hash of the home>.service, so instances never share a unit and a release finds the unit an earlier one wrote.

Source

pub fn config(&self) -> PathBuf

The settings file a person edits.

Source

pub fn credentials(&self) -> PathBuf

Sign-ins SCV writes itself.

Source

pub fn channel_credentials(&self, channel: &str) -> PathBuf

One channel’s account credentials, <account>.json each.

Source

pub fn agents(&self) -> PathBuf

The private homes of delegated agent CLIs.

Source

pub fn agent_home(&self, agent: &str) -> PathBuf

Source

pub fn skills(&self) -> PathBuf

Source

pub fn history(&self) -> PathBuf

The chat log, <channel>/<account>/<conversation>/ (see crate::history), and by default the files the owner kept.

Source

pub fn state(&self) -> PathBuf

Runtime data SCV writes and reads back; never edited by hand.

Source

pub fn socket(&self) -> PathBuf

Source

pub fn delegations(&self) -> PathBuf

Records of running delegated agents.

Source

pub fn conversations(&self) -> PathBuf

Markers of live delegated conversations, for scv agents gc.

Source

pub fn imports(&self) -> PathBuf

What each scv agents import copied, and from where.

Source

pub fn channel_state(&self, channel: &str) -> PathBuf

One channel’s delivery state and account locks.

Source

pub fn media(&self) -> PathBuf

Files chat users sent, under <channel>/<account>, and copies of files the model sends back, under outbox.

Source

pub fn outbox(&self) -> PathBuf

Copies of files the model attached, waiting to be sent to a chat.

Source

pub fn update_plan(&self) -> PathBuf

A planned restart in progress.

Source

pub fn last_owner(&self) -> PathBuf

The chat the account owner last wrote from.

Source

pub fn daemon_marker(&self) -> PathBuf

Present while a daemon runs; one left behind means it did not shut down cleanly.

Source

pub fn config_lock(&self) -> PathBuf

Serializes SCV’s own edits of config.toml.

Source

pub fn strays(&self) -> Result<Vec<Stray>>

Entries of the home that SCV does not read, sorted by name.

Trait Implementations§

Source§

impl Clone for Layout

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Layout

Source§

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

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

impl Eq for Layout

Source§

impl PartialEq for Layout

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Layout

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

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.