pub struct Released {
pub session: SessionUri,
pub thread: ThreadName,
pub item: String,
pub must_clear: bool,
}Expand description
A claim that is free now.
use riff_core::record::{Claimed, Released};
let claim = Claimed {
session: "riff://ann@heron/acme/app?session=s1".parse()?,
thread: "acme/app".parse()?,
item: "issue-7".into(),
};
let released = Released::of(claim.clone());
let json = serde_json::to_string(&released).unwrap();
// A record from before the mark has the same fields.
assert_eq!(json, serde_json::to_string(&claim).unwrap());
assert!(!serde_json::from_str::<Released>(&json).unwrap().must_clear);
let last = Released { must_clear: true, ..released };
assert!(serde_json::to_string(&last).unwrap().ends_with(r#""must_clear":true}"#));Fields§
§session: SessionUri§thread: ThreadName§item: String§must_clear: boolTrue when the session is a worker that released its last claim itself: it must clear its context before its next claim (01M3X9XAK1KPZZVM1AJR2H8DSS).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Released
impl<'de> Deserialize<'de> for Released
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 Released
impl JsonSchema for Released
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 moreimpl Eq for Released
impl StructuralPartialEq for Released
Auto Trait Implementations§
impl Freeze for Released
impl RefUnwindSafe for Released
impl Send for Released
impl Sync for Released
impl Unpin for Released
impl UnsafeUnpin for Released
impl UnwindSafe for Released
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
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.