Struct ApplicationDefinition
pub struct ApplicationDefinition {
pub app_id: Cow<'static, str>,
pub title: Cow<'static, str>,
pub icon: IconDescriptor,
pub record_kind: RecordKind,
pub required: Vec<PermissionScope>,
pub optional: Vec<PermissionScope>,
pub opens: &'static [&'static str],
pub workspace_record: bool,
pub member_record: bool,
pub opens_before_record: bool,
pub create: fn(HostContext, LaunchTarget, RestoreInput) -> Result<AppComponent, LaunchError>,
}Fields§
§app_id: Cow<'static, str>The app’s package id. Owned: a runtime that runs installed packages
(tilolang) learns it from the launch (TILO_PACKAGE_ID), not from its
source. Self::app_id borrows it for as long as the definition lives.
title: Cow<'static, str>The app’s name, as the definition’s runtime learns it.
icon: IconDescriptor§record_kind: RecordKind§required: Vec<PermissionScope>§optional: Vec<PermissionScope>§opens: &'static [&'static str]Media types (type/subtype, lowercase) the component opens when a host
hands it a file (HostContext::take_open_file); ANY_MEDIA_TYPE
for a component that opens every file (a hex editor).
workspace_record: boolThe app keeps one record per workspace, the workspace’s own (a conversation everyone in the workspace shares), rather than a record per window: every window of the app in the workspace opens it, and the first creates it.
member_record: boolThe record a window opens when it names none is the person’s own record of the
workspace (RecordId::of_member) rather than the workspace’s record of the app: what
it keeps there (their mail) only their devices read. A person without a root identity
is a member of no workspace and opens the workspace’s record as before.
opens_before_record: boolThe app’s window shows before the workspace’s record is read: a record this device holds
opens off the frame, and the component takes it in when it is decoded
(HostContext::record_opening). Only for an app that
keeps one record per workspace.
create: fn(HostContext, LaunchTarget, RestoreInput) -> Result<AppComponent, LaunchError>Implementations§
§impl ApplicationDefinition
impl ApplicationDefinition
pub fn member_record_of(&self, author: &UserId) -> Option<RecordCheckout>
pub fn member_record_of(&self, author: &UserId) -> Option<RecordCheckout>
The record a window of author opens when it names none, when the app keeps each
member’s own (Self::member_record): their own record of the workspace.
pub fn keeps_workspace_record(&self) -> bool
pub fn keeps_workspace_record(&self) -> bool
Whether the app keeps one record per workspace, its package primary,
rather than a record per window (Self::workspace_record).
pub fn unsaved_target(
&self,
records: &RecordStore,
) -> Result<LaunchTarget, RecordOpenError>
pub fn unsaved_target( &self, records: &RecordStore, ) -> Result<LaunchTarget, RecordOpenError>
pub fn opens_media_type(&self, media_type: &str) -> bool
pub fn opens_media_type(&self, media_type: &str) -> bool
Whether the component opens files of media_type (parameters and case ignored).
ANY_MEDIA_TYPE among Self::opens opens every file.
pub fn instantiate(
&self,
context: HostContext,
target: LaunchTarget,
restore: RestoreInput,
) -> Result<AppComponent, LaunchError>
pub fn instantiate( &self, context: HostContext, target: LaunchTarget, restore: RestoreInput, ) -> Result<AppComponent, LaunchError>
Validate, invoke the one factory under its lifetime, then restore presentation only.
The factory projects through HostContext::read_record; no mutable Widget::sync
or second history/autosave initialization follows its View restoration.
§Errors
Ready records survive any checked validation or setup failure through
ComponentSetup’s strong owner; Reserved failures cancel without publication.
Auto Trait Implementations§
impl Freeze for ApplicationDefinition
impl RefUnwindSafe for ApplicationDefinition
impl Send for ApplicationDefinition
impl Sync for ApplicationDefinition
impl Unpin for ApplicationDefinition
impl UnsafeUnpin for ApplicationDefinition
impl UnwindSafe for ApplicationDefinition
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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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