Skip to main content

Kernel

Struct Kernel 

Source
pub struct Kernel { /* private fields */ }

Implementations§

Source§

impl Kernel

Source

pub fn execute( &mut self, raw_target: impl AsRef<str>, body: Option<ExecuteValue>, ) -> Result<ExecuteValue, ExecuteError>

Source

pub fn execute_ast( &mut self, target: MeTargetAst, body: Option<ExecuteValue>, ) -> Result<ExecuteValue, ExecuteError>

Source

pub fn install_recipient_key( &mut self, recipient_key_id: &str, private_key: impl Into<Vec<u8>>, ) -> Result<&mut Self, ExecuteError>

Source

pub fn uninstall_recipient_key(&mut self, recipient_key_id: &str) -> &mut Self

Source

pub fn store_wrapped_key( &mut self, key_id: &str, envelope: Value, recipient_key_id: Option<String>, ) -> Result<&mut Self, ExecuteError>

Source

pub fn read_wrapped_key(&self, key_id: &str) -> Result<Value, ExecuteError>

Source

pub fn key_space_manifest(&self) -> BTreeMap<String, StoredWrappedKey>

Source§

impl Kernel

Source

pub fn new() -> Self

Source

pub fn with_seed(seed: impl Into<String>) -> Self

Source

pub fn with_compound_seed(who: &str, secret: &str) -> Self

Source

pub fn memories(&self) -> &[Memory]

Source

pub fn set_seed(&mut self, seed: impl Into<String>) -> &mut Self

Source

pub fn reseed_identity(&mut self, who: &str, secret: &str) -> &mut Self

Source

pub fn identity_hash(&self) -> Option<&str>

Source

pub fn active_expression(&self) -> Option<&str>

Source

pub fn set_active_expression( &mut self, expression: impl Into<Option<String>>, ) -> &mut Self

Source

pub fn prove_with_timestamp( &self, input: ProofInput, timestamp: u64, ) -> Result<ProofResult, ProofError>

Source

pub fn inspect(&self) -> InspectResult

Source

pub fn inspect_last(&self, last: usize) -> InspectResult

Source

pub fn active_identity(&self) -> Option<&str>

Source

pub fn operators(&self) -> &BTreeMap<String, OperatorDefinition>

Source

pub fn events(&self) -> &[KernelEvent]

Source

pub fn event_cursor(&self) -> usize

Source

pub fn events_since(&self, cursor: usize) -> &[KernelEvent]

Source

pub fn drain_events_since(&mut self, cursor: usize) -> Vec<KernelEvent>

Source

pub fn drain_events(&mut self) -> Vec<KernelEvent>

Source

pub fn events_matching( &self, path: impl IntoPath, ) -> Result<Vec<KernelEvent>, KernelError>

Source

pub fn drain_events_matching( &mut self, path: impl IntoPath, ) -> Result<Vec<KernelEvent>, KernelError>

Source

pub fn clear_events(&mut self) -> &mut Self

Source

pub fn operator_kind(&self, operator: &str) -> Option<&str>

Source

pub fn recompute_mode(&self) -> RecomputeMode

Source

pub fn set_recompute_mode(&mut self, mode: RecomputeMode) -> &mut Self

Source

pub fn define_operator( &mut self, operator: &str, kind: &str, ) -> Result<(), KernelError>

Source

pub fn is_secret_scope(&self, path: impl IntoPath) -> bool

Source

pub fn is_noise_scope(&self, path: impl IntoPath) -> bool

Source

pub fn effective_secret( &self, path: impl IntoPath, ) -> Result<String, KernelError>

Source

pub fn secret_material_v3( &self, path: impl IntoPath, mode: SecretMaterialMode, purpose: SecretMaterialPurpose, ) -> Result<[u8; 32], KernelError>

Source

pub fn secret_blob_keys_v3( &self, path: impl IntoPath, mode: SecretMaterialMode, ) -> Result<BlobV3DerivedKeys, KernelError>

Source

pub fn encrypt_secret_value_v3( &self, path: impl IntoPath, value: impl Into<Value>, nonce: [u8; 16], ) -> Result<String, KernelError>

Source

pub fn decrypt_secret_value_v3( &self, path: impl IntoPath, blob: &str, ) -> Result<Option<Value>, KernelError>

Source

pub fn postulate( &mut self, path: impl IntoPath, value: impl Into<Value>, ) -> Result<&Memory, KernelError>

Source

pub fn postulate_with_operator( &mut self, path: impl IntoPath, operator: Option<String>, value: impl Into<Value>, ) -> Result<&Memory, KernelError>

Source

pub fn remove(&mut self, path: impl IntoPath) -> Result<&Memory, KernelError>

Source

pub fn derive( &mut self, scope: impl IntoPath, name: impl IntoPath, expression: &str, ) -> Result<&Memory, KernelError>

Source

pub fn collect<I, P>(&self, paths: I) -> Result<Value, KernelError>
where I: IntoIterator<Item = P>, P: IntoPath,

Source

pub fn query<I, P>( &mut self, target_path: impl IntoPath, paths: I, ) -> Result<&Memory, KernelError>
where I: IntoIterator<Item = P>, P: IntoPath,

Source

pub fn noise( &mut self, path: impl IntoPath, noise: &str, ) -> Result<&Memory, KernelError>

Source

pub fn secret( &mut self, path: impl IntoPath, secret: &str, ) -> Result<&Memory, KernelError>

Source

pub fn pointer( &mut self, path: impl IntoPath, target: impl IntoPath, ) -> Result<&Memory, KernelError>

Source

pub fn claim_identity(&mut self, id: &str) -> Result<&Memory, KernelError>

Source

pub fn identity( &mut self, path: impl IntoPath, id: &str, ) -> Result<&Memory, KernelError>

Source

pub fn read(&self, path: impl IntoPath) -> Option<&Value>

Source

pub fn read_fresh(&mut self, path: impl IntoPath) -> Option<Value>

Source

pub fn read_public(&self, path: impl IntoPath) -> Option<&Value>

Source

pub fn children( &self, prefix: impl IntoPath, ) -> Result<Vec<String>, KernelError>

Source

pub fn read_public_subtree( &self, prefix: impl IntoPath, ) -> Result<Option<Value>, KernelError>

Source

pub fn explain_fresh( &mut self, path: impl IntoPath, ) -> Result<ExplainResult, KernelError>

Source

pub fn explain(&self, path: impl IntoPath) -> Result<ExplainResult, KernelError>

Source

pub fn export_snapshot(&self) -> Snapshot

Source

pub fn hydrate(snapshot: Snapshot) -> Result<Self, KernelError>

Source

pub fn learn(&mut self, memory: &Memory) -> Result<&Memory, KernelError>

Source

pub fn replay_memories<I>(&mut self, memories: I) -> Result<(), KernelError>
where I: IntoIterator<Item = Memory>,

Trait Implementations§

Source§

impl Clone for Kernel

Source§

fn clone(&self) -> Kernel

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 Kernel

Source§

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

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

impl Default for Kernel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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, <T as TryFrom<U>>::Error>

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.