pub struct MockAdapter { /* private fields */ }Expand description
A mock adapter that simulates a vehicle for testing.
Returns realistic values for standard PIDs and configurable DTCs.
Implementations§
Trait Implementations§
Source§impl Adapter for MockAdapter
impl Adapter for MockAdapter
Source§fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<AdapterInfo, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<AdapterInfo, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the adapter: reset, detect chipset, configure protocol.
Returns information about the detected adapter hardware.
Source§fn request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
req: &'life1 ServiceRequest,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
req: &'life1 ServiceRequest,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a diagnostic service request and return the raw response data bytes.
Response should NOT include the service ID echo or padding — just data.
Source§fn supported_pids<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Pid>, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn supported_pids<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Pid>, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query which standard PIDs are supported (Mode 01 PID 00/20/40/60 bitmaps).
Source§fn battery_voltage<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<f64>, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn battery_voltage<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<f64>, Obd2Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the adapter’s battery voltage measurement (if supported).
Source§fn info(&self) -> &AdapterInfo
fn info(&self) -> &AdapterInfo
Return adapter information detected during initialization.
Source§impl Debug for MockAdapter
impl Debug for MockAdapter
Auto Trait Implementations§
impl Freeze for MockAdapter
impl RefUnwindSafe for MockAdapter
impl Send for MockAdapter
impl Sync for MockAdapter
impl Unpin for MockAdapter
impl UnsafeUnpin for MockAdapter
impl UnwindSafe for MockAdapter
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