Remove default impl for Device::limits().
We should not assume any default MTU.v0.7.x
parent
f3e54966fd
commit
312ff93c86
|
@ -12,7 +12,7 @@ use std::collections::VecDeque;
|
|||
use collections::{Vec, VecDeque};
|
||||
|
||||
use Error;
|
||||
use super::Device;
|
||||
use super::{Device, DeviceLimits};
|
||||
|
||||
/// A loopback interface.
|
||||
#[derive(Debug)]
|
||||
|
@ -32,6 +32,13 @@ impl Device for Loopback {
|
|||
type RxBuffer = Vec<u8>;
|
||||
type TxBuffer = TxBuffer;
|
||||
|
||||
fn limits(&self) -> DeviceLimits {
|
||||
DeviceLimits {
|
||||
max_transmission_unit: 65535,
|
||||
..DeviceLimits::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn receive(&mut self) -> Result<Self::RxBuffer, Error> {
|
||||
match self.0.borrow_mut().pop_front() {
|
||||
Some(packet) => Ok(packet),
|
||||
|
|
|
@ -162,9 +162,7 @@ pub trait Device {
|
|||
type TxBuffer: AsRef<[u8]> + AsMut<[u8]>;
|
||||
|
||||
/// Get a description of device limitations.
|
||||
fn limits(&self) -> DeviceLimits {
|
||||
DeviceLimits::default()
|
||||
}
|
||||
fn limits(&self) -> DeviceLimits;
|
||||
|
||||
/// Receive a frame.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue