Struct atomic_lib::store::Store[][src]

pub struct Store { /* fields omitted */ }
Expand description

The in-memory store of data, containing the Resources, Properties and Classes

Implementations

Creates an empty Store. Run .populate() to get useful standard models loaded into your store.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Adds a Resource to the store. Replaces existing resource with the contents. In most cases, you should use .commit() instead.

Adds Atoms to the store. Will replace existing Atoms that share Subject / Property combination. Validates datatypes and required props presence. Read more

Adds a Resource to the store. Replaces existing resource with the contents. Does not do any validations. Read more

Returns a collection with all resources in the store. If Include_external is false, this is filtered by selecting only resoureces that match the self URL of the store. WARNING: This could be very expensive! Read more

Returns the root URL where the default store is. E.g. https://example.com This is where deltas should be sent to. Also useful for Subject URL generation. Read more

Returns the default Agent for applying commits.

Returns a full Resource with native Values. Note that this does not construct dynamic Resources, such as collections. If you’re not sure what to use, use get_resource_extended. Read more

Removes a resource from the store. Errors if not present.

Sets the default Agent for applying commits.

Adds an Atom to the PropSubjectMap. Overwrites if already present. The default implementation for this does not do anything, so overwrite it if your store needs indexing. Read more

Constructs the value index from all resources in the store. Could take a while.

Returns the root URL where this instance of the store is hosted. Should return None if this is simply a client and not a server. E.g. https://example.com Read more

Create an Agent, storing its public key. An Agent is required for signing Commits. Returns a tuple of (subject, private_key). Make sure to store the private_key somewhere safe! Does not create a Commit - the recommended way is to use agent.to_resource().save_locally(). Read more

Exports the store to a big JSON-AD file. Sorts the export by first exporting Property Resources, which makes importing faster and more dependent. Read more

Fetches a resource, makes sure its subject matches. Save to the store. Read more

Retrieves a Class from the store by subject URL and converts it into a Class useful for forms

Finds all classes (isA) for any subject. Returns an empty vector if there are none. Read more

Fetches a property by URL, returns a Property instance

Get’s the resource, parses the Query parameters and calculates dynamic properties. Defaults to get_resource if store doesn’t support extended resources Read more

Imports a JSON-AD string, returns the amount of imported resources

Triple Pattern Fragments interface. Use this for most queries, e.g. finding all items with some property / value combination. Returns an empty array if nothing is found. Read more

Accepts an Atomic Path string, returns the result value (resource or property value) E.g. https://example.com description or thing isa 0 https://docs.atomicdata.dev/core/paths.html Read more

Loads the default store. For DBs it also adds default Collections and Endpoints.

Removes an Atom from the PropSubjectMap.

Performs a light validation, without fetching external data

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.