Skip to main content

take

Function take 

Source
pub fn take<S, E>(slot: usize) -> Option<S>
where S: Write<Error = E> + Read<Error = E> + Send + 'static,
Expand description

Take (consume) a serial port from the specified slot index.

Returns Some(S) if the slot contains a serial port of type S, None otherwise. Note: This consumes the serial port from the slot, leaving it empty.