MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / peek

Method peek

crates/chat-cli/src/cli/chat/parser.rs:577–588  ·  view source on GitHub ↗

Returns the next event in the [SendMessageOutput] without consuming it.

(&mut self)

Source from the content-addressed store, hash-verified

575
576 /// Returns the next event in the [SendMessageOutput] without consuming it.
577 async fn peek(&mut self) -> Result<Option<&ChatResponseStream>, RecvError> {
578 if self.peek.is_some() {
579 return Ok(self.peek.as_ref());
580 }
581 match self.next().await? {
582 Some(v) => {
583 self.peek = Some(v);
584 Ok(self.peek.as_ref())
585 },
586 None => Ok(None),
587 }
588 }
589
590 /// Consumes the next [SendMessageOutput] event.
591 async fn next(&mut self) -> Result<Option<ChatResponseStream>, RecvError> {

Callers 4

parse_argsFunction · 0.45
recvMethod · 0.45
parse_tool_useMethod · 0.45
absolute_to_relativeFunction · 0.45

Calls 2

as_refMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected