summaryrefslogtreecommitdiffstats
path: root/src/platform/dummy.rs
blob: 208febea671daaad2b3bb2211c800cfb421e94b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#[cfg(test)]
use super::super::wireguard::dummy;
use super::BindOwner;
use super::PlatformBind;

pub struct VoidOwner {}

impl BindOwner for VoidOwner {
    type Error = dummy::BindError;

    fn set_fwmark(&self, value: Option<u32>) -> Option<Self::Error> {
        None
    }
}

impl PlatformBind for dummy::PairBind {
    type Owner = VoidOwner;

    fn bind(_port: u16) -> Result<(Vec<Self::Reader>, Self::Writer, Self::Owner), Self::Error> {
        Err(dummy::BindError::Disconnected)
    }
}