Struct PackageRegistry
pub struct PackageRegistry { /* private fields */ }Expand description
The packages a Host can install, by package name.
Every registry holds the natives, such as runvil/subagents, from
the start. A Host adds the PACKAGE constant of each Plugin crate it
links, lists what the registry holds, and builds its
HostContext over it, which installs Plugins by
package name.
Implementations§
§impl PackageRegistry
impl PackageRegistry
pub fn new() -> PackageRegistry
pub fn new() -> PackageRegistry
A registry holding only the natives.
pub fn add(&mut self, package: Package) -> Result<(), InstallError>
pub fn add(&mut self, package: Package) -> Result<(), InstallError>
Adds package as a linked package, so a Host can install it by its
name.
§Errors
Returns InstallError::InvalidPackage when the package name is
not a vendor/name pair of valid one-segment names, and
InstallError::DuplicatePackage when the registry holds the name
already, as it holds each native’s from the start.
pub fn list(&self) -> impl Iterator<Item = (&Package, PluginKind)>
pub fn list(&self) -> impl Iterator<Item = (&Package, PluginKind)>
Every package the registry holds, natives included, with its kind, in package name order.
Trait Implementations§
§impl Debug for PackageRegistry
impl Debug for PackageRegistry
§impl Default for PackageRegistry
impl Default for PackageRegistry
§fn default() -> PackageRegistry
fn default() -> PackageRegistry
A registry holding only the natives.
Auto Trait Implementations§
impl Freeze for PackageRegistry
impl RefUnwindSafe for PackageRegistry
impl Send for PackageRegistry
impl Sync for PackageRegistry
impl Unpin for PackageRegistry
impl UnsafeUnpin for PackageRegistry
impl UnwindSafe for PackageRegistry
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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