Struct r_extcap::controls::asynchronous::ExtcapControlReader
source · pub struct ExtcapControlReader { /* private fields */ }
Expand description
A reader for the Extcap control pipe.
Implementations§
source§impl ExtcapControlReader
impl ExtcapControlReader
sourcepub async fn new(in_path: &Path) -> Self
pub async fn new(in_path: &Path) -> Self
Creates a new instance of ExtcapControlReader
.
in_path
: The path of the extcap control pipe passed with--extcap-control-in
.
sourcepub async fn read_control_packet(
&mut self
) -> Result<ControlPacket<'static>, ReadControlError>
pub async fn read_control_packet( &mut self ) -> Result<ControlPacket<'static>, ReadControlError>
Read one control packet, awaiting until the packet arrives. Since the
control packet pipe is expected to stay open for the entire duration of
the extcap program, if the pipe is closed prematurely in this function
here, UnexpectedEof
will be returned.