Struct AppComponent
pub struct AppComponent { /* private fields */ }Expand description
Real app content and its lifetime; hosts cannot extract an unbound root.
Implementations§
§impl AppComponent
impl AppComponent
pub fn take_replacement(&mut self) -> Option<ComponentReplacement>
pub fn take_replacement(&mut self) -> Option<ComponentReplacement>
The component the app built to show another record in this one’s place, once: the host closes this component and mounts that one.
pub const fn set_behaviour(&mut self, behaviour: ComponentBehaviour)
pub const fn set_behaviour(&mut self, behaviour: ComponentBehaviour)
Set how the hosting window treats this component’s tree.
pub fn collaborate_through(
&self,
connector: HostSessionConnector,
) -> Option<CollaborationManager>
pub fn collaborate_through( &self, connector: HostSessionConnector, ) -> Option<CollaborationManager>
A collaboration manager for this component’s record, reached through
the host’s connector as an app the host launched: what a host
showing the component inside its own process hands the App it runs
it in, so the component publishes and is invoked through the session
broker as a launched app is. None when the component’s records have
no route the broker could acknowledge.
pub fn register_document_history(
&mut self,
definition: &'static HistoryDefinition,
) -> Result<(), HistoryRegistrationError>
pub fn register_document_history( &mut self, definition: &'static HistoryDefinition, ) -> Result<(), HistoryRegistrationError>
Register presentation for this component’s actual document custody. Every domain scope reads that record; external scopes retain their stated reason. This metadata carries no new authority and follows native/headless/tile mounts.
§Errors
Refuses missing, stale or foreign document custody and invalid scope metadata.
pub fn register_document_and_file_history(
&mut self,
definition: &'static HistoryDefinition,
files: FileHistorySource,
) -> Result<(), HistoryRegistrationError>
pub fn register_document_and_file_history( &mut self, definition: &'static HistoryDefinition, files: FileHistorySource, ) -> Result<(), HistoryRegistrationError>
Register presentation for this component’s document, as
Self::register_document_history, and for the files of the mounted
filesystem it shows: every checked-file scope reads the file files
names.
§Errors
pub fn new( context: HostContext, root: Box<dyn AppWidget>, registry: ActionRegistry, ) -> AppComponent
pub fn record(&self) -> &RecordCheckout
pub fn mount(
&mut self,
sink: impl Fn(WakeEvent) + Send + Sync + 'static,
) -> Result<(), LaunchError>
pub fn mount( &mut self, sink: impl Fn(WakeEvent) + Send + Sync + 'static, ) -> Result<(), LaunchError>
§Errors
A component can be mounted once and a closed lifetime cannot be reopened.
pub fn mount_with_owner_queue(
&mut self,
queue: &OwnerWakeQueue,
sink: impl Fn(WakeEvent) + Send + Sync + 'static,
) -> Result<(), LaunchError>
pub fn mount_with_owner_queue( &mut self, queue: &OwnerWakeQueue, sink: impl Fn(WakeEvent) + Send + Sync + 'static, ) -> Result<(), LaunchError>
Mount with exact-owner queue intake while retaining the original host sink. Registration owns no application callback and its sink retains only weak metadata.
§Errors
Refuses unprepared, already registered, stale or closed components.
pub fn capture_local_view(&self) -> Result<View, ThawError>
pub fn capture_local_view(&self) -> Result<View, ThawError>
§Errors
Rejects closed components and invalid widget geometry.
pub fn restore_local_view(&mut self, view: &View) -> Result<(), ThawError>
pub fn restore_local_view(&mut self, view: &View) -> Result<(), ThawError>
Local hooks cover scroll, mode and focused ephemeral state. App-specific fields
absent from View are unsupported; they must not be smuggled in as document bytes.
§Errors
Rejects malformed geometry or closed components before invoking widget hooks.
pub fn suspend(&mut self) -> ComponentCloseReport
pub fn close(&mut self) -> ComponentCloseReport
pub fn close(&mut self) -> ComponentCloseReport
Save through the original store, retain failures, and permanently close this lifetime.
pub fn close_report(&self) -> Option<&ComponentCloseReport>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppComponent
impl !RefUnwindSafe for AppComponent
impl !Send for AppComponent
impl !Sync for AppComponent
impl Unpin for AppComponent
impl UnsafeUnpin for AppComponent
impl !UnwindSafe for AppComponent
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> 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