pub struct Workspace { /* private fields */ }
Expand description

A utility for discovering and initializing the well-known paths for a working copy of a sphere and relevant global Noosphere configuration

Implementations

Read the local content of the workspace in its entirety, filtered by an optional glob pattern. The glob pattern is applied to the file path relative to the workspace. This includes files that have not yet been saved to the sphere. All files are chunked into blocks, and those blocks are persisted to the provided store. TODO(#105): We may want to change this to take an optional list of paths to consider, and allow the user to rely on their shell for glob filtering

Produces a manifest of changes (added, updated and removed) derived from the current state of the workspace

Reads the latest local version of the sphere and renders its contents to files in the workspace. Note that this will overwrite any existing files in the workspace.

Given a file extension, infer its mime

Given a mime, infer its file extension

Produce a matcher that will match any path that should be ignored when considering the files that make up the local workspace

The root directory containing the working copy of sphere files on disk, as well as the local sphere data

The path to the sphere data folder within the working file tree

The path to the block storage database within the working file tree

The path to the folder that contains global Noosphere configuration and keys generated by the user

The path to the folder containing user-generated keys when there is no secure option for generating them available

Path to the local authorization (the granted UCAN) for the key that is authorized to work on the sphere

The path to the file containing the DID of the local key used to operate on the local sphere

The path to the file containing the DID of the sphere that is being worked on in this local workspace

Attempts to read the locally stored authorization that enables the key to operate on this sphere; the returned authorization may be represented as either a UCAN or the CID of a UCAN

Produces a SphereDb<NativeStore> referring to the block storage backing the sphere in the local workspace

Get the key material (with both verification and signing capabilities) for the locally configured author key.

Get the identity of the sphere being worked on in the local workspace as a DID string

Look up the DID for the key by its name

Returns true if there are no files in the configured root path

Reads all the available keys and returns a map of their names to their DIDs

If there is only one key to choose from, returns its name. Otherwise returns an error result.

Asserts that all related directories for the suggested working file tree root are present

Asserts that the global Noosphere directories are present

Creates all the directories needed to start rendering a sphere in the configured working file tree root

Creates the global Noosphere config and keys directories

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Scrape the references from an impl Read. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more