pub struct JobTemplates {
pub templates_dir: PathBuf,
/* private fields */
}Fields§
§templates_dir: PathBufImplementations§
Source§impl JobTemplates
impl JobTemplates
pub fn new( templates_dir: PathBuf, data_dir: &Path, builtins: &'static [Builtin], ) -> Self
pub fn reporters(&self) -> &Arc<Reporters> ⓘ
pub fn install_global(self) -> &'static Arc<JobTemplates> ⓘ
pub fn list(&self) -> Vec<JobTemplateInfo>
Sourcepub fn get(&self, id: &str) -> Option<(JobTemplateInfo, Option<Package>)>
pub fn get(&self, id: &str) -> Option<(JobTemplateInfo, Option<Package>)>
One template, and its brief when it is valid.
Sourcepub fn approve(
&self,
id: &str,
hash: &str,
shown_signer: &str,
) -> Result<(), String>
pub fn approve( &self, id: &str, hash: &str, shown_signer: &str, ) -> Result<(), String>
Record the operator’s approval of exactly hash, signed by the key
whose fingerprint their prompt showed (shown_signer, “” for
unsigned); only the host route calls this. Fails if the template or
its signature changed since the prompt was shown.
Sourcepub fn resolve_approved(
&self,
id: &str,
version: &str,
) -> Result<ApprovedTemplate, String>
pub fn resolve_approved( &self, id: &str, version: &str, ) -> Result<ApprovedTemplate, String>
The approved template id at version, read from disk now: an
error if it isn’t installed at that version, isn’t approved, or
changed since the operator approved it.
Sourcepub fn approved_cloud(&self, id: &str) -> Option<ApprovedTemplate>
pub fn approved_cloud(&self, id: &str) -> Option<ApprovedTemplate>
The approved cloud template id, read from disk now: what the events of a cloud job are matched to. None
if it isn’t installed, isn’t a cloud template, isn’t approved, or changed since the operator approved it.
Sourcepub fn approved_clouds(&self) -> Vec<ApprovedTemplate>
pub fn approved_clouds(&self) -> Vec<ApprovedTemplate>
Every approved cloud template, read from disk now: the cloud jobs the watchdog looks after.
Sourcepub fn install(&self, source: &Path, replace: bool) -> Result<String, String>
pub fn install(&self, source: &Path, replace: bool) -> Result<String, String>
Copy the template at source (a folder, its template.json, or a
.zip) into the templates folder, waiting for approval.
Sourcepub fn uninstall(&self, id: &str) -> Result<(), String>
pub fn uninstall(&self, id: &str) -> Result<(), String>
Delete an installed template’s folder and its approval.
Sourcepub fn publishers(&self) -> Vec<WidgetPublisherPin>
pub fn publishers(&self) -> Vec<WidgetPublisherPin>
The publishers pinned to a key, for Settings.
Sourcepub fn forget_publisher(&self, publisher: &str) -> Result<(), String>
pub fn forget_publisher(&self, publisher: &str) -> Result<(), String>
Forget a publisher’s key (the operator’s, through the host route).
pub fn catalogs(&self) -> Vec<Catalog>
Sourcepub fn add_catalog(&self, url: &str, public_key: &str) -> Result<(), String>
pub fn add_catalog(&self, url: &str, public_key: &str) -> Result<(), String>
Add a private catalog, or change its key (the operator’s, through the host route).
pub fn remove_catalog(&self, url: &str) -> Result<(), String>
Auto Trait Implementations§
impl !Freeze for JobTemplates
impl RefUnwindSafe for JobTemplates
impl Send for JobTemplates
impl Sync for JobTemplates
impl Unpin for JobTemplates
impl UnsafeUnpin for JobTemplates
impl UnwindSafe for JobTemplates
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> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§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