pub struct Item {
pub id: String,
pub title: Option<String>,
pub description: Option<String>,
pub status: String,
pub sources: Vec<Source>,
pub metadata: Value,
pub session_id: Option<String>,
pub worktree: Option<Worktree>,
pub blocked_by: Vec<String>,
pub errors: Vec<Value>,
pub created_at: String,
pub updated_at: String,
}Fields§
§id: String§title: Option<String>§description: Option<String>§status: String§sources: Vec<Source>§metadata: Value§session_id: Option<String>Always serialized, even when null.
worktree: Option<Worktree>§blocked_by: Vec<String>§errors: Vec<Value>§created_at: String§updated_at: StringImplementations§
Source§impl Item
We need the JSON field order to match Ruby exactly.
Ruby to_h outputs: id, (title if present), (description if present),
status, sources, metadata, session_id, created_at, updated_at,
(worktree if present), (blocked_by if non-empty), (errors if non-empty).
impl Item
We need the JSON field order to match Ruby exactly.
Ruby to_h outputs: id, (title if present), (description if present),
status, sources, metadata, session_id, created_at, updated_at,
(worktree if present), (blocked_by if non-empty), (errors if non-empty).
serde by default serializes in struct field order, so we order the fields to match. But Ruby puts title BEFORE status when present, and worktree/ blocked_by/errors AFTER updated_at. Let’s use a custom serializer.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Item
impl<'de> Deserialize<'de> for Item
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
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
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