pub struct CapabilityReply<'a> { /* private fields */ }Expand description
A terminal host’s capability reply, with borrowed state and kind lists.
Advertise only capabilities the host implements. Omitted lists use the
fixed revision 0.4 defaults; explicit empty lists advertise no support.
A default reply has the same bytes as a query. On terminal-to-program input,
interpret parser::Event::Query using the caller’s pending-query state.
Implementations§
Source§impl<'a> CapabilityReply<'a>
impl<'a> CapabilityReply<'a>
Sourcepub const fn states(self, states: &'a [State]) -> Self
pub const fn states(self, states: &'a [State]) -> Self
Advertises these states in order; an empty slice advertises none.
Sourcepub const fn kinds(self, kinds: &'a [Kind]) -> Self
pub const fn kinds(self, kinds: &'a [Kind]) -> Self
Advertises these blocking reasons in order; an empty slice advertises none.
Sourcepub fn write_to<W: Write + ?Sized>(self, output: &mut W) -> Result<(), Error>
pub fn write_to<W: Write + ?Sized>(self, output: &mut W) -> Result<(), Error>
Encodes the complete reply before writing to the caller’s writer. Uses no heap allocation and does not flush.
§Errors
Returns parser::Error::Limit wrapped in Error::Parser before any
output if the reply exceeds the complete-frame cap. Writer failures
return Error::Io and can leave a partial frame.