pub struct UsbLogger<const N: usize, T: ReceiverHandler + Send + Sync> { /* private fields */ }Expand description
The logger handle, which contains a pipe with configurable size for buffering log messages.
Implementations§
Source§impl<const N: usize, T: ReceiverHandler + Send + Sync> UsbLogger<N, T>
 
impl<const N: usize, T: ReceiverHandler + Send + Sync> UsbLogger<N, T>
Sourcepub const fn with_custom_style(
    custom_style: fn(&Record<'_>, &mut Writer<'_, N>),
) -> Self
 
pub const fn with_custom_style( custom_style: fn(&Record<'_>, &mut Writer<'_, N>), ) -> Self
Create a new logger instance with a custom formatter.
Sourcepub fn with_handler(&mut self, handler: T)
 
pub fn with_handler(&mut self, handler: T)
Add a command handler to the logger
Sourcepub async fn run<'d, D>(
    &'d self,
    state: &'d mut LoggerState<'d>,
    driver: D,
) -> !where
    D: Driver<'d>,
    Self: 'd,
 
pub async fn run<'d, D>(
    &'d self,
    state: &'d mut LoggerState<'d>,
    driver: D,
) -> !where
    D: Driver<'d>,
    Self: 'd,
Run the USB logger using the state and USB driver. Never returns.
Sourcepub async fn create_future_from_class<'d, D>(
    &'d self,
    class: CdcAcmClass<'d, D>,
)where
    D: Driver<'d>,
 
pub async fn create_future_from_class<'d, D>(
    &'d self,
    class: CdcAcmClass<'d, D>,
)where
    D: Driver<'d>,
Creates the futures needed for the logger from a given class This can be used in cases where the usb device is already in use for another connection
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize, T> !Freeze for UsbLogger<N, T>
impl<const N: usize, T> !RefUnwindSafe for UsbLogger<N, T>
impl<const N: usize, T> Send for UsbLogger<N, T>
impl<const N: usize, T> Sync for UsbLogger<N, T>
impl<const N: usize, T> Unpin for UsbLogger<N, T>where
    T: Unpin,
impl<const N: usize, T> UnwindSafe for UsbLogger<N, T>where
    T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more