Struct ApplicationHost
pub struct ApplicationHost { /* private fields */ }Implementations§
§impl ApplicationHost
impl ApplicationHost
pub fn with_models(self, models: Models) -> 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>
pub fn views(&self) -> &Rc<InstanceViewStore>
The view store this host keeps: where a saved view of an instance is read and written.
Who is at this device, as the host prepared them.
pub fn permissions(&self) -> &SharedPermissions
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>
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>
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>
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>)
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>
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>
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>
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>
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>
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§
impl Freeze for ApplicationHost
impl !RefUnwindSafe for ApplicationHost
impl !Send for ApplicationHost
impl !Sync for ApplicationHost
impl Unpin for ApplicationHost
impl UnsafeUnpin for ApplicationHost
impl !UnwindSafe for ApplicationHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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 Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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