pub struct ResponseContext<'a> {
pub actor: &'a ActorContext,
pub conversation: &'a ConversationId,
pub turn_id: TurnId,
pub channel: ResolutionChannel,
pub current_revision: CaseRevision,
pub now: DateTime<Utc>,
}Expand description
What a client answer is judged against (spec §15.5).
It exists so the six things that decide whether a click is valid — who is clicking, in which conversation and turn, how the answer arrived, what revision the case is really at, and when “now” is — travel together and none of them can be forgotten at a call site.
Fields§
§actor: &'a ActorContextThe authenticated actor.
conversation: &'a ConversationIdThe conversation the card belongs to.
turn_id: TurnIdThe turn that is answering.
channel: ResolutionChannelHow the answer arrived (spec §15.7).
current_revision: CaseRevisionThe revision the case is at, read fresh.
now: DateTime<Utc>The instant to judge expiry against.
Implementations§
Source§impl<'a> ResponseContext<'a>
impl<'a> ResponseContext<'a>
Sourcepub fn click(
actor: &'a ActorContext,
conversation: &'a ConversationId,
turn_id: TurnId,
current_revision: CaseRevision,
now: DateTime<Utc>,
) -> Self
pub fn click( actor: &'a ActorContext, conversation: &'a ConversationId, turn_id: TurnId, current_revision: CaseRevision, now: DateTime<Utc>, ) -> Self
A structured click.
Sourcepub const fn through(self, channel: ResolutionChannel) -> Self
pub const fn through(self, channel: ResolutionChannel) -> Self
Returns a copy that arrived on another channel.
Trait Implementations§
Source§impl<'a> Clone for ResponseContext<'a>
impl<'a> Clone for ResponseContext<'a>
impl<'a> Copy for ResponseContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for ResponseContext<'a>
impl<'a> RefUnwindSafe for ResponseContext<'a>
impl<'a> Send for ResponseContext<'a>
impl<'a> Sync for ResponseContext<'a>
impl<'a> Unpin for ResponseContext<'a>
impl<'a> UnsafeUnpin for ResponseContext<'a>
impl<'a> UnwindSafe for ResponseContext<'a>
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