pub struct Request { /* private fields */ }Expand description
One state and its ordered questions, with optional request-owned assets.
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(state: State, questions: Questions) -> Result<Self>
pub fn new(state: State, questions: Questions) -> Result<Self>
Construct a nonempty request, rejecting empty names before any provider call.
§Errors
Returns InvalidArgument if questions are empty or any question name is
empty. Image references are checked later by Request::validate, so
assets may be attached after construction.
Sourcepub fn with_questions(&self, questions: Questions) -> Result<Self>
pub fn with_questions(&self, questions: Questions) -> Result<Self>
Replace questions while preserving state and attached assets.
§Errors
Returns InvalidArgument if the replacement map is empty or contains
an empty question name.
Sourcepub fn with_assets(self, assets: Assets) -> Self
Available on crate feature images only.
pub fn with_assets(self, assets: Assets) -> Self
images only.Attach an explicit asset registry, validated before dispatch.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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