pub struct SetPlan {
pub me: SessionUri,
pub base: Option<u64>,
pub plan: PlanSet,
}Expand description
POST /v1/plan: a session sends the full plan of its repository
thread (01M4A4YTNSJR0R1T9JNXPBSKHC). base is the position of the
plan_set record of the plan that the client compared with, or
None when the server had no plan. A base that is not the
position on the server gets the code stale_base
(01M4A4YTR2NKVBPE6BT9EC3X75).
use riff_core::record::{Plan, PlanItem, PlanSet};
use riff_core::wire::{Call, SetPlan};
let plan = SetPlan {
me: "riff://mike@pangolin/como-technologies/riff?session=a1".parse()?,
base: Some(3001),
plan: PlanSet {
thread: "como-technologies/riff".parse()?,
plan: Plan {
wave: None,
items: vec![PlanItem { item: "issue-366".into(), needs: vec![] }],
done: vec![],
},
},
};
assert_eq!(SetPlan::PATH, "/v1/plan");
assert_eq!(
serde_json::to_string(&plan).unwrap(),
r#"{"me":"riff://mike@pangolin/como-technologies/riff?session=a1","base":3001,"plan":{"thread":"como-technologies/riff","items":[{"item":"issue-366","needs":[]}],"done":[]}}"#
);Fields§
§me: SessionUri§base: Option<u64>§plan: PlanSetTrait Implementations§
Source§impl<'de> Deserialize<'de> for SetPlan
impl<'de> Deserialize<'de> for SetPlan
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
Source§impl JsonSchema for SetPlan
impl JsonSchema for SetPlan
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for SetPlan
impl RefUnwindSafe for SetPlan
impl Send for SetPlan
impl Sync for SetPlan
impl Unpin for SetPlan
impl UnsafeUnpin for SetPlan
impl UnwindSafe for SetPlan
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