[−][src]Struct serial_frame::SerialFrameSender
The frame sender structure, this will create a SerialFrameSender, that once started will split incoming bytes from the serialport and send them framed by the separator
Ex: "This is one line\nAnd this is another\n"
will return "This is one line\n", and "This is another\n" in two separate vectors over the channel sent in when starting the thread
Methods
impl SerialFrameSender
[src]
pub fn new(separator: u8, port: Box<dyn SerialPort>) -> SerialFrameSender
[src]
pub fn add_error_channel(&mut self) -> Receiver<SerialFrameError>
[src]
pub fn start<T: 'static + Send + TryFrom<Vec<u8>>>(
self,
type_send: Sender<T>
) -> Result<SerialFrameStopper>
[src]
self,
type_send: Sender<T>
) -> Result<SerialFrameStopper>
Consumes the SerialFrameSender and creates a new running thread, that will send complete
frames over the Channel it takes as input separated by the specified separator. It will
also try to convert those bytes into a Type that has implemented the TryFrom<Vec
Returned is structure that can be used to stop this thread, and thus unblock the serialport or an error
pub fn stop(&mut self)
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SerialFrameSender
impl Send for SerialFrameSender
impl !Sync for SerialFrameSender
impl Unpin for SerialFrameSender
impl !UnwindSafe for SerialFrameSender
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,