Skip to main content

ApplicationHost

Struct ApplicationHost 

pub struct ApplicationHost { /* private fields */ }

Implementations§

§

impl ApplicationHost

pub fn with_models(self, models: Models) -> ApplicationHost

Use the model capability authorized for this host’s authenticated session. Every subsequently prepared component receives the same session, without installing a process-wide client.

pub fn views(&self) -> &Rc<InstanceViewStore>

The view store this host keeps: where a saved view of an instance is read and written.

pub fn device_id(&self) -> &str

The device this host runs the app on.

pub fn author(&self) -> &UserId

Who is at this device, as the host prepared them.

pub fn permissions(&self) -> &SharedPermissions

The participant’s permissions, as the host follows them.

pub fn new_with_profile_lifetime( profile_root: PathBuf, device_id: String, workspace_id: &str, author: UserId, permissions: SharedPermissions, action_context: ActionContext, lifetime: Rc<dyn Any>, ) -> Result<ApplicationHost, LaunchError>

Keep a host-owned profile resource (such as a temporary capture directory) alive through record writers and failed record or presentation save retries. The resource must own the supplied profile root for its entire lifetime.

pub fn new( profile_root: PathBuf, device_id: String, workspace_id: &str, author: UserId, permissions: SharedPermissions, action_context: ActionContext, ) -> Result<ApplicationHost, LaunchError>

A host persisting under a local profile directory.

§Errors

Rejects invalid explicit profile and identity inputs. No files are opened.

pub fn with_store( store: Rc<dyn DurableStore>, device_id: String, workspace_id: &str, author: UserId, permissions: SharedPermissions, action_context: ActionContext, ) -> Result<ApplicationHost, LaunchError>

A host persisting records and local views through store.

pub fn keep_person_records_in(&mut self, store: Rc<dyn DurableStore>)

Keep the person’s own records (crate::record::person) in store rather than the host’s: the directory a launcher shares between an app’s launches in every workspace.

pub fn records_for( &mut self, definition: &ApplicationDefinition, ) -> Result<RecordStore, LaunchError>

Return the unique canonical writer registry for this app and workspace. Migration adapters use this owner too; they must never start a second saver.

§Errors

Rejects denied requirements and invalid package/storage namespaces.

pub fn saved_view_for( &self, definition: &ApplicationDefinition, instance_id: u64, checkout: &RecordCheckout, ) -> Result<Option<SavedInstanceView>, LaunchError>

Validate the local binding before a migration adapter touches any source.

§Errors

Rejects unreadable, malformed or foreign presentation without repairing it.

pub fn saved_record( &self, definition: &ApplicationDefinition, instance_id: u64, ) -> Result<Option<RecordCheckout>, LaunchError>

The record this instance’s saved presentation names, when it names one of definition’s kind: a window carried in from another workspace arrives showing its own record rather than the workspace’s default.

§Errors

Unreadable or foreign presentation.

pub fn prepare_default( &mut self, definition: &ApplicationDefinition, instance_id: u64, default: RecordCheckout, initial_view: Option<ApplicationLocalView>, runner_inputs: ComponentRunnerInputs, ) -> Result<PreparedComponentInputs, LaunchError>

Open the record this instance’s saved presentation names, else the host’s stable default record, or reserve that for the definition’s New factory. Restore presentation from this exact device/workspace/instance. A saved view pointing at a missing record is an error, never a blank replacement. A record moved out of this workspace is never reopened: a view still naming it is dropped, and a retired record gives way to its successor. initial_view is used only when this instance has no saved presentation.

§Errors

Rejects invalid/foreign views, contested writers, corrupt records and denied authority.

pub fn prepare_record( &mut self, definition: &ApplicationDefinition, instance_id: u64, checkout: RecordCheckout, runner_inputs: ComponentRunnerInputs, ) -> Result<PreparedComponentInputs, LaunchError>

Open checkout for instance_id, or reserve it for the definition’s New factory when it does not exist yet: the record a launch named (the file a person opened), whatever the instance showed before. The instance’s saved presentation is restored only when it is of that record; one of another record is left for the next save to replace.

§Errors

Rejects foreign kinds, contested writers, corrupt records and denied authority.

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
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: 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.
§

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.
§

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.
§

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.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,