pub struct Draft {
pub name: String,
pub schedule: String,
pub prompt: String,
pub deliver: Option<String>,
pub route: Option<String>,
pub workdir: Option<String>,
pub skills: Vec<String>,
pub schema: Option<String>,
pub enabled: bool,
}Expand description
A job as a surface submits it: cron add’s arguments, or a page’s form.
One struct and one set of checks, because the two front ends must not disagree about what a job
is. enabled is the only field a create does not have to mention; everything else is the
caller’s, and the errors are the parsers’ own words so the two surfaces say the same sentence.
Fields§
§name: String§schedule: String§prompt: String§deliver: Option<String>§route: Option<String>§workdir: Option<String>§skills: Vec<String>§schema: Option<String>§enabled: boolImplementations§
Source§impl Draft
impl Draft
Sourcepub fn to_job(&self) -> Result<Job>
pub fn to_job(&self) -> Result<Job>
The job this describes, or why it does not describe one.
A prompt is required and a schedule is parsed here rather than at 07:30 in a log nobody
reads; a workdir is checked to be a directory for the same reason — a workspace that is a
typo is a job whose files land somewhere else, or nowhere.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Draft
impl<'de> Deserialize<'de> for Draft
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for Draft
impl Freeze for Draft
impl Move for Draft
impl RefUnwindSafe for Draft
impl Send for Draftwhere
RawVecInner: Send,
impl Sync for Draftwhere
RawVecInner: Sync,
impl Unpin for Draft
impl UnsafeUnpin for Draftwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Draftwhere
RawVecInner: UnwindSafe,
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