pub struct HeaderQuestions { /* private fields */ }Expand description
The header source of a host that answers over a pull channel (the FFI
event queue, the conformance shim’s stdio). Each read asks the host one
question under a fresh request id and blocks until Self::provide
answers it, HEADER_ANSWER_WAIT_MS pass on the clock, or
Self::close runs. clock is monotonic milliseconds; a waiter
re-checks it on every answer, every Self::recheck, and at its
deadline in real time.
Implementations§
Source§impl HeaderQuestions
impl HeaderQuestions
pub fn new( ask: impl Fn(u64, &HeaderContext, Option<&[(String, String)]>) + Send + Sync + 'static, clock: impl Fn() -> i64 + Send + Sync + 'static, ) -> Arc<Self> ⓘ
Sourcepub fn source(self: &Arc<Self>) -> HeaderSource
pub fn source(self: &Arc<Self>) -> HeaderSource
The header source whose reads ask these questions.
Sourcepub fn provide(&self, id: u64, headers: &Value) -> Result<(), TransportError>
pub fn provide(&self, id: u64, headers: &Value) -> Result<(), TransportError>
Answer question id with headers: an object of string values, or
null when the host cannot produce headers. An answer to an unknown
or expired id is ignored.
Auto Trait Implementations§
impl !Freeze for HeaderQuestions
impl !RefUnwindSafe for HeaderQuestions
impl !UnwindSafe for HeaderQuestions
impl Forget for HeaderQuestions
impl Move for HeaderQuestions
impl Send for HeaderQuestions
impl Sync for HeaderQuestions
impl Unpin for HeaderQuestions
impl UnsafeUnpin for HeaderQuestions
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