pub struct StepApproval {
pub approved_by: String,
pub at: DateTime<Utc>,
pub user_id: Uuid,
}Expand description
One vote cast on an approval gate.
Votes are unique per user_id: an API key votes as
its owner, and a user voting twice is ignored by the store.
§Examples
use chrono::Utc;
use ironflow_store::entities::StepApproval;
use uuid::Uuid;
let vote = StepApproval {
user_id: Uuid::now_v7(),
approved_by: "alice".to_string(),
at: Utc::now(),
};
assert_eq!(vote.approved_by, "alice");JSON schema
{
"description": "One vote cast on an approval gate.\n\nVotes are unique per [`user_id`](StepApproval::user_id): an API key votes as\nits owner, and a user voting twice is ignored by the store.\n\n# Examples\n\n```\nuse chrono::Utc;\nuse ironflow_store::entities::StepApproval;\nuse uuid::Uuid;\n\nlet vote = StepApproval {\n user_id: Uuid::now_v7(),\n approved_by: \"alice\".to_string(),\n at: Utc::now(),\n};\nassert_eq!(vote.approved_by, \"alice\");\n```",
"type": "object",
"required": [
"approved_by",
"at",
"user_id"
],
"properties": {
"approved_by": {
"description": "Display name of the voter at vote time.",
"type": "string"
},
"at": {
"description": "When the vote was cast.",
"type": "string",
"format": "date-time"
},
"user_id": {
"description": "The user who voted.",
"type": "string",
"format": "uuid"
}
}
}
```ignore
</details>Fields§
§approved_by: StringDisplay name of the voter at vote time.
at: DateTime<Utc>When the vote was cast.
user_id: UuidThe user who voted.
Implementations§
Source§impl StepApproval
impl StepApproval
pub fn builder() -> StepApproval
Trait Implementations§
Source§impl Clone for StepApproval
impl Clone for StepApproval
Source§impl Debug for StepApproval
impl Debug for StepApproval
Source§impl<'de> Deserialize<'de> for StepApproval
impl<'de> Deserialize<'de> for StepApproval
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 From<StepApproval> for StepApproval
impl From<StepApproval> for StepApproval
Source§fn from(value: StepApproval) -> Self
fn from(value: StepApproval) -> Self
Converts to this type from the input type.
Source§impl Serialize for StepApproval
impl Serialize for StepApproval
Source§impl TryFrom<StepApproval> for StepApproval
impl TryFrom<StepApproval> for StepApproval
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: StepApproval) -> Result<Self, ConversionError>
fn try_from(value: StepApproval) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for StepApproval
impl RefUnwindSafe for StepApproval
impl Send for StepApproval
impl Sync for StepApproval
impl Unpin for StepApproval
impl UnsafeUnpin for StepApproval
impl UnwindSafe for StepApproval
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