Struct radio_api::Connection [−][src]
pub struct Connection { /* fields omitted */ }
A connection is like a stream, but allowed parsed reads with properly buffered input data.
Methods
impl Connection
[src]
impl Connection
pub fn new(stream: Box<Stream>) -> Connection
[src]
pub fn new(stream: Box<Stream>) -> Connection
Convenience constructor to create connection from stream.
pub fn write(&self, data: &[u8]) -> RadioResult<()>
[src]
pub fn write(&self, data: &[u8]) -> RadioResult<()>
Write out raw bytes to the underlying stream.
pub fn read<T>(&self, parse: ParseFn<T>) -> RadioResult<T>
[src]
pub fn read<T>(&self, parse: ParseFn<T>) -> RadioResult<T>
Read the next object using provided parser.
Auto Trait Implementations
impl !Send for Connection
impl !Send for Connection
impl !Sync for Connection
impl !Sync for Connection