pub enum AdoptError {
Own(ExecutionId),
}Expand description
Why an execution was not adopted from a report.
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 },
};
use majordomus_cli::execution::{ActorKind, AdoptError};
let own = ExecutionId::fresh();
let mut mine = seed();
mine.actor = Actor::of(ActorKind::Http);
store.create(
own.clone(), mine.capability, mine.title, mine.input, mine.cancellable, mine.actor,
mine.repository,
);
assert_eq!(store.adopt(own.clone(), seed(), 4242), Err(AdoptError::Own(own)));Variants§
Own(ExecutionId)
The id names an execution this process runs itself; a report cannot write into it.
Trait Implementations§
Source§impl Clone for AdoptError
impl Clone for AdoptError
Source§fn clone(&self) -> AdoptError
fn clone(&self) -> AdoptError
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 AdoptError
impl Debug for AdoptError
Source§impl Display for AdoptError
impl Display for AdoptError
impl Eq for AdoptError
Source§impl Error for AdoptError
impl Error for AdoptError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for AdoptError
impl PartialEq for AdoptError
Source§fn eq(&self, other: &AdoptError) -> bool
fn eq(&self, other: &AdoptError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AdoptError
Auto Trait Implementations§
impl Freeze for AdoptError
impl RefUnwindSafe for AdoptError
impl Send for AdoptError
impl Sync for AdoptError
impl Unpin for AdoptError
impl UnsafeUnpin for AdoptError
impl UnwindSafe for AdoptError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.