pub struct DefinitionCatalog { /* private fields */ }Expand description
The job definitions one embedding application authorizes for launch.
Implementations§
Source§impl DefinitionCatalog
impl DefinitionCatalog
Sourcepub fn new() -> Self
pub fn new() -> Self
Builds an empty catalog.
A CLI built on an empty catalog serves every command except launch
and execution restart.
Sourcepub fn register(
&mut self,
identity: DefinitionIdentity,
) -> Result<(), CatalogError>
pub fn register( &mut self, identity: DefinitionIdentity, ) -> Result<(), CatalogError>
Registers one job definition.
§Errors
Returns CatalogError::AnonymousDefinition when the identity carries
no job name and CatalogError::DuplicateJob when the name is already
registered.
Sourcepub fn with(self, identity: DefinitionIdentity) -> Result<Self, CatalogError>
pub fn with(self, identity: DefinitionIdentity) -> Result<Self, CatalogError>
Registers one job definition and returns the catalog.
§Errors
Returns the same rejections as DefinitionCatalog::register.
Sourcepub fn get(&self, job_name: &JobName) -> Option<&DefinitionIdentity>
pub fn get(&self, job_name: &JobName) -> Option<&DefinitionIdentity>
Returns the registered identity of one job name.
Sourcepub fn job_names(&self) -> impl ExactSizeIterator<Item = &JobName>
pub fn job_names(&self) -> impl ExactSizeIterator<Item = &JobName>
Iterates registered job names in canonical order.
Trait Implementations§
Source§impl Clone for DefinitionCatalog
impl Clone for DefinitionCatalog
Source§fn clone(&self) -> DefinitionCatalog
fn clone(&self) -> DefinitionCatalog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefinitionCatalog
impl Debug for DefinitionCatalog
Source§impl Default for DefinitionCatalog
impl Default for DefinitionCatalog
Source§fn default() -> DefinitionCatalog
fn default() -> DefinitionCatalog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DefinitionCatalog
impl RefUnwindSafe for DefinitionCatalog
impl Send for DefinitionCatalog
impl Sync for DefinitionCatalog
impl Unpin for DefinitionCatalog
impl UnsafeUnpin for DefinitionCatalog
impl UnwindSafe for DefinitionCatalog
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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