pub struct QuestionResolver { /* private fields */ }Expand description
Resolves pending interactive questions by matching response ids to waiting receivers. Cloneable so it can be handed to the UI layer.
Implementations§
Source§impl QuestionResolver
impl QuestionResolver
Sourcepub fn register(&self, id: String) -> Receiver<QuestionResponse>
pub fn register(&self, id: String) -> Receiver<QuestionResponse>
Register a pending question, returning the receiver for the response.
Sourcepub fn resolve(&self, response: QuestionResponse) -> bool
pub fn resolve(&self, response: QuestionResponse) -> bool
Resolves a pending question by id. Returns true if a matching request
was found and resolved.
Trait Implementations§
Source§impl Clone for QuestionResolver
impl Clone for QuestionResolver
Source§fn clone(&self) -> QuestionResolver
fn clone(&self) -> QuestionResolver
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QuestionResolver
impl RefUnwindSafe for QuestionResolver
impl Send for QuestionResolver
impl Sync for QuestionResolver
impl Unpin for QuestionResolver
impl UnsafeUnpin for QuestionResolver
impl UnwindSafe for QuestionResolver
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