pub async fn serve_fidl_iterator_from_slice<I>(
fidl_iterator: I,
items: impl AsMut<[<I::Responder as FidlIteratorNextResponder>::Item]>,
) -> Result<()>where
I: FidlIteratorRequestStream,
Expand description
Serves fidl iterators like:
protocol PayloadIterator {
Next() -> (vector
from:
fidl_iterator
: effectively a stream of PayloadIterator::Next
requests
items
: a slice of Payload
s.
Fills each response to Next()
with as many entries as will fit in a fidl message. The
returned future completes after Next()
yields an empty response or the iterator
is interrupted (client closes the channel or the task encounters a FIDL layer error).
To use with a new protocol (e.g. PayloadIterator
), in this crate:
- implement
FidlIteratorRequestStream
forPayloadIteratorRequestStream
- implement
FidlIteratorNextResponder
forPayloadIteratorNextResponder
- implement
Measurable
forPayload
using functions generated by //tools/fidl/measure-tape