mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-08 21:43:44 +02:00
More trait cleanup.
This commit is contained in:
parent
3e713360e3
commit
5006580c41
1 changed files with 5 additions and 5 deletions
|
@ -80,7 +80,7 @@ pub trait HostSystem: Sync + Send + 'static {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trait to be implemented by outside code to provide object storage to VL1
|
/// Trait to be implemented by outside code to provide object storage to VL1
|
||||||
pub trait NodeStorage: Sync + Send + 'static {
|
pub trait NodeStorage: Sync + Send {
|
||||||
/// Load this node's identity from the data store.
|
/// Load this node's identity from the data store.
|
||||||
fn load_node_identity(&self) -> Option<Identity>;
|
fn load_node_identity(&self) -> Option<Identity>;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ pub trait NodeStorage: Sync + Send + 'static {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trait to be implemented to provide path hints and a filter to approve physical paths.
|
/// Trait to be implemented to provide path hints and a filter to approve physical paths.
|
||||||
pub trait PathFilter: Sync + Send + 'static {
|
pub trait PathFilter: Sync + Send {
|
||||||
/// Called to check and see if a physical address should be used for ZeroTier traffic to a node.
|
/// Called to check and see if a physical address should be used for ZeroTier traffic to a node.
|
||||||
fn should_use_physical_path<HostSystemImpl: HostSystem + ?Sized>(
|
fn should_use_physical_path<HostSystemImpl: HostSystem + ?Sized>(
|
||||||
&self,
|
&self,
|
||||||
|
@ -128,7 +128,7 @@ pub enum PacketHandlerResult {
|
||||||
///
|
///
|
||||||
/// This is implemented by Switch in VL2. It's usually not used outside of VL2 in the core but
|
/// This is implemented by Switch in VL2. It's usually not used outside of VL2 in the core but
|
||||||
/// it could also be implemented for testing or "off label" use of VL1 to carry different protocols.
|
/// it could also be implemented for testing or "off label" use of VL1 to carry different protocols.
|
||||||
pub trait InnerProtocol: Sync + Send + 'static {
|
pub trait InnerProtocol: Sync + Send {
|
||||||
/// Handle a packet, returning true if it was handled by the next layer.
|
/// Handle a packet, returning true if it was handled by the next layer.
|
||||||
///
|
///
|
||||||
/// Do not attempt to handle OK or ERROR. Instead implement handle_ok() and handle_error().
|
/// Do not attempt to handle OK or ERROR. Instead implement handle_ok() and handle_error().
|
||||||
|
@ -996,7 +996,7 @@ enum PathKey<'a, 'b, HostSystemImpl: HostSystem + ?Sized> {
|
||||||
Ref(&'a Endpoint, &'b HostSystemImpl::LocalSocket),
|
Ref(&'a Endpoint, &'b HostSystemImpl::LocalSocket),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b, HostSystemImpl: HostSystem + ?Sized> Hash for PathKey<'a, 'b, HostSystemImpl> {
|
impl<HostSystemImpl: HostSystem + ?Sized> Hash for PathKey<'_, '_, HostSystemImpl> {
|
||||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||||
match self {
|
match self {
|
||||||
Self::Copied(ep, ls) => {
|
Self::Copied(ep, ls) => {
|
||||||
|
@ -1024,7 +1024,7 @@ impl<HostSystemImpl: HostSystem + ?Sized> PartialEq for PathKey<'_, '_, HostSyst
|
||||||
|
|
||||||
impl<HostSystemImpl: HostSystem + ?Sized> Eq for PathKey<'_, '_, HostSystemImpl> {}
|
impl<HostSystemImpl: HostSystem + ?Sized> Eq for PathKey<'_, '_, HostSystemImpl> {}
|
||||||
|
|
||||||
impl<'a, 'b, HostSystemImpl: HostSystem + ?Sized> PathKey<'a, 'b, HostSystemImpl> {
|
impl<HostSystemImpl: HostSystem + ?Sized> PathKey<'_, '_, HostSystemImpl> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn local_socket(&self) -> &HostSystemImpl::LocalSocket {
|
fn local_socket(&self) -> &HostSystemImpl::LocalSocket {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Add table
Reference in a new issue