pub struct Answers { /* private fields */ }Expand description
Represents the answers collected from an interview
Implementations§
Source§impl Answers
impl Answers
pub fn new() -> Self
pub fn insert(&mut self, key: String, value: AnswerValue)
pub fn get(&self, key: &str) -> Option<&AnswerValue>
pub fn merge(&mut self, other: Self)
pub fn as_string(&self, key: &str) -> Result<String, AnswerError>
pub fn as_int(&self, key: &str) -> Result<i64, AnswerError>
pub fn as_float(&self, key: &str) -> Result<f64, AnswerError>
pub fn as_bool(&self, key: &str) -> Result<bool, AnswerError>
pub fn as_nested(&self, key: &str) -> Result<&Self, AnswerError>
Sourcepub fn as_int_list(&self, key: &str) -> Result<Vec<i64>, AnswerError>
pub fn as_int_list(&self, key: &str) -> Result<Vec<i64>, AnswerError>
Get a list of integers (for multi-select answers)
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &AnswerValue)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &AnswerValue)>
Iterate over all key-value pairs
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Answers
impl RefUnwindSafe for Answers
impl Send for Answers
impl Sync for Answers
impl Unpin for Answers
impl UnwindSafe for Answers
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