pub struct Seed<'a> {
pub capability: &'a str,
pub title: &'a str,
pub input: Value,
pub cancellable: bool,
pub actor: Actor,
pub repository: RepositoryRef,
}Expand description
What an execution is when it is created: everything about it that does not move.
use majordomus_cli::execution::{Actor, EventPayload, ExecutionId, ExecutionState};
use majordomus_cli::execution::{ExecutionStore, Limits, RepositoryRef, Seed};
let store = ExecutionStore::new(Limits::default());
let seed = || Seed {
capability: "executions.demonstrate",
title: "Demonstrate an execution",
input: serde_json::json!({ "steps": 1 }),
cancellable: true,
actor: Actor::reported(4242),
repository: RepositoryRef { name: "r".into(), id: "id".into(), branch: None },
};
let id = ExecutionId::fresh();
store.adopt(id.clone(), seed(), 4242).unwrap();
let held = store.get(&id).unwrap();
assert_eq!(held.capability, "executions.demonstrate");
assert_eq!((held.state, held.actor.pid), (ExecutionState::Queued, Some(4242)));Fields§
§capability: &'a strThe capability’s canonical id.
title: &'a strIts title.
input: ValueThe input, with every sensitive value already replaced.
cancellable: boolWhether asking it to stop will do anything.
actor: ActorWho asked for it.
repository: RepositoryRefWhich repository it runs against.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Seed<'a>
impl<'a> RefUnwindSafe for Seed<'a>
impl<'a> Send for Seed<'a>
impl<'a> Sync for Seed<'a>
impl<'a> Unpin for Seed<'a>
impl<'a> UnsafeUnpin for Seed<'a>
impl<'a> UnwindSafe for Seed<'a>
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