LoopbackInterface → Loopback.

This commit is contained in:
whitequark 2017-07-14 01:17:06 +00:00
parent 63ab7d4e7a
commit f3e54966fd
2 changed files with 6 additions and 6 deletions

View File

@ -16,19 +16,19 @@ use super::Device;
/// A loopback interface.
#[derive(Debug)]
pub struct LoopbackInterface(Rc<RefCell<VecDeque<Vec<u8>>>>);
pub struct Loopback(Rc<RefCell<VecDeque<Vec<u8>>>>);
impl LoopbackInterface {
impl Loopback {
/// Creates a loopback interface.
///
/// Every packet transmitted through this interface will be received through it
/// in FIFO order.
pub fn new() -> LoopbackInterface {
LoopbackInterface(Rc::new(RefCell::new(VecDeque::new())))
pub fn new() -> Loopback {
Loopback(Rc::new(RefCell::new(VecDeque::new())))
}
}
impl Device for LoopbackInterface {
impl Device for Loopback {
type RxBuffer = Vec<u8>;
type TxBuffer = TxBuffer;

View File

@ -118,7 +118,7 @@ mod tap_interface;
pub use self::tracer::Tracer;
pub use self::fault_injector::FaultInjector;
#[cfg(any(feature = "std", feature = "collections"))]
pub use self::loopback::LoopbackInterface;
pub use self::loopback::Loopback;
#[cfg(any(feature = "raw_socket"))]
pub use self::raw_socket::RawSocket;
#[cfg(all(feature = "tap_interface", target_os = "linux"))]