pub struct Config {Show 20 fields
pub privacy_level: isize,
pub location: Option<String>,
pub roles: HashSet<Role>,
pub entry_peers: Vec<Multiaddr>,
pub keypair: Keypair,
pub listen_on: Vec<Multiaddr>,
pub namespace: String,
pub discovery_ttl: Option<u64>,
pub static_exits: Vec<Multiaddr>,
pub static_routes: Vec<RouteDescriptor>,
pub sserver_listen_addr: String,
pub sclient_listen_addr: String,
pub fdlimit: bool,
pub external_addrs: Vec<Multiaddr>,
pub outbound_addrs: Vec<Multiaddr>,
pub is_fly_io: bool,
pub protect_socket_fn: Option<ProtectSocketFn>,
pub token: Option<String>,
pub device_id: Option<String>,
pub route_auth_enabled: bool,
}Fields§
§privacy_level: isizePeer privacy level
The lower the level, the more privacy is granted
This parameter affects geohash precision and internal behaviour
From 0 to 12 If 0 is provided no location will be set
location: Option<String>Peer geohashed location
roles: HashSet<Role>Peer behaviour roles
entry_peers: Vec<Multiaddr>First HOP peer multiaddresses
keypair: KeypairPeer identity keypair
listen_on: Vec<Multiaddr>§namespace: StringDiscovery namespace
discovery_ttl: Option<u64>Discovery TTL in seconds
static_exits: Vec<Multiaddr>Static Exits deprecated
static_routes: Vec<RouteDescriptor>Static routes
sserver_listen_addr: StringSocks Listen Address
sclient_listen_addr: StringSocks Client Listen Address
fdlimit: boolmodify fdlimit
external_addrs: Vec<Multiaddr>External addresses
outbound_addrs: Vec<Multiaddr>Outbound addresses
is_fly_io: boolFly.io mode.
protect_socket_fn: Option<ProtectSocketFn>§token: Option<String>§device_id: Option<String>§route_auth_enabled: boolImplementations§
Source§impl Config
impl Config
pub fn has_entry(&self, id: &PeerId) -> bool
pub fn has_static_exit(&self, id: &PeerId) -> bool
pub fn with_role(&mut self, role: Role)
pub fn with_privacy_level(self, privacy_level: isize) -> Result<Self, Error>
pub fn with_location(self, location: String) -> Self
pub fn with_coordinates(self, coord: Coord) -> Result<Self, GeohashError>
pub fn with_first_hops(self, first_hops: Vec<Multiaddr>) -> Self
pub fn with_first_hop(self, first_hop: Multiaddr) -> Self
pub fn with_roles(self, roles: HashSet<Role>) -> Self
pub fn with_keypair(self, keypair: Keypair) -> Self
pub fn with_sserver_listen_addr(self, listen_addr: String) -> Self
pub fn with_sclient_listen_addr(self, listen_addr: String) -> Self
pub fn with_external_addrs(self, external_addrs: Vec<Multiaddr>) -> Self
pub fn with_outbound_addrs(self, outbound_addrs: Vec<Multiaddr>) -> Self
pub fn with_fly_io(self, is_fly_io: bool) -> Self
pub fn with_protect_socket_fn( self, protect_socket_fn: Arc<dyn Fn(i32) + Send + Sync>, ) -> Self
pub fn with_token(self, token: String) -> Self
pub fn with_route_auth_enabled(self, route_auth_enabled: bool) -> Self
pub fn seal(self) -> Result<Vec<u8>, Error>
pub fn unseal(data: Vec<u8>) -> Result<Self, Error>
Trait Implementations§
Source§impl From<&Config> for SnowstormBehaviour
impl From<&Config> for SnowstormBehaviour
Source§fn from(config: &Config) -> SnowstormBehaviour
fn from(config: &Config) -> SnowstormBehaviour
Converts to this type from the input type.
Source§impl From<Config> for SerializableConfig
impl From<Config> for SerializableConfig
Source§impl From<SerializableConfig> for Config
impl From<SerializableConfig> for Config
Source§fn from(config: SerializableConfig) -> Self
fn from(config: SerializableConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more