pub struct HostRouter { /* private fields */ }Expand description
One router per connection: the surfaces it created, the packages installed, the extension catalogs negotiated.
Implementations§
Source§impl HostRouter
impl HostRouter
Sourcepub fn new<S: AsRef<str>>(extension_ids: &[S]) -> Self
pub fn new<S: AsRef<str>>(extension_ids: &[S]) -> Self
extension_ids = the extension catalog ids the host registered.
Sourcepub fn with_extensions<S: AsRef<str>>(
extension_ids: &[S],
extensions: Option<Vec<AvailableExtension>>,
) -> Self
pub fn with_extensions<S: AsRef<str>>( extension_ids: &[S], extensions: Option<Vec<AvailableExtension>>, ) -> Self
Self::new with the registered extensions’ versions and components
(the TS HostRouterOptions.extensions).
pub fn supported_catalog_ids(&self) -> Vec<String>
pub fn register_extension(&mut self, id: &str)
Sourcepub fn register_extension_with(
&mut self,
id: &str,
available: Option<AvailableExtension>,
)
pub fn register_extension_with( &mut self, id: &str, available: Option<AvailableExtension>, )
VAPP-161: with its version and components (None = {id}), kept
when the router checks extensions at all.
Sourcepub fn install_package(&mut self, pkg: &Value) -> Vec<PackageIssue>
pub fn install_package(&mut self, pkg: &Value) -> Vec<PackageIssue>
Install a declarative package: its templates become applyTemplate
targets. Returns the validation issues (installed only when none).
pub fn package(&self, id: &str) -> Option<&Value>
pub fn surface(&self, id: &str) -> Option<&SurfaceInfo>
Sourcepub fn surface_ids(&self) -> Vec<String>
pub fn surface_ids(&self) -> Vec<String>
In creation order.
Sourcepub fn package_id_of(&self, surface_id: &str) -> Option<String>
pub fn package_id_of(&self, surface_id: &str) -> Option<String>
The package whose template created the surface.
Trait Implementations§
Source§impl Clone for HostRouter
impl Clone for HostRouter
Source§impl Debug for HostRouter
impl Debug for HostRouter
Auto Trait Implementations§
impl Freeze for HostRouter
impl RefUnwindSafe for HostRouter
impl Send for HostRouter
impl Sync for HostRouter
impl Unpin for HostRouter
impl UnsafeUnpin for HostRouter
impl UnwindSafe for HostRouter
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
Mutably borrows from an owned value. Read more