Struct Config

Source
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: isize

Peer 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: Keypair

Peer identity keypair

§listen_on: Vec<Multiaddr>§namespace: String

Discovery 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: String

Socks Listen Address

§sclient_listen_addr: String

Socks Client Listen Address

§fdlimit: bool

modify fdlimit

§external_addrs: Vec<Multiaddr>

External addresses

§outbound_addrs: Vec<Multiaddr>

Outbound addresses

§is_fly_io: bool

Fly.io mode.

§protect_socket_fn: Option<ProtectSocketFn>§token: Option<String>§device_id: Option<String>§route_auth_enabled: bool

Implementations§

Source§

impl Config

Source

pub fn has_entry(&self, id: &PeerId) -> bool

Source

pub fn has_static_exit(&self, id: &PeerId) -> bool

Source

pub fn with_role(&mut self, role: Role)

Source

pub fn with_privacy_level(self, privacy_level: isize) -> Result<Self, Error>

Source

pub fn with_location(self, location: String) -> Self

Source

pub fn with_coordinates(self, coord: Coord) -> Result<Self, GeohashError>

Source

pub fn with_first_hops(self, first_hops: Vec<Multiaddr>) -> Self

Source

pub fn with_first_hop(self, first_hop: Multiaddr) -> Self

Source

pub fn with_roles(self, roles: HashSet<Role>) -> Self

Source

pub fn with_keypair(self, keypair: Keypair) -> Self

Source

pub fn with_sserver_listen_addr(self, listen_addr: String) -> Self

Source

pub fn with_sclient_listen_addr(self, listen_addr: String) -> Self

Source

pub fn with_external_addrs(self, external_addrs: Vec<Multiaddr>) -> Self

Source

pub fn with_outbound_addrs(self, outbound_addrs: Vec<Multiaddr>) -> Self

Source

pub fn with_fly_io(self, is_fly_io: bool) -> Self

Source

pub fn with_protect_socket_fn( self, protect_socket_fn: Arc<dyn Fn(i32) + Send + Sync>, ) -> Self

Source

pub fn with_token(self, token: String) -> Self

Source

pub fn with_route_auth_enabled(self, route_auth_enabled: bool) -> Self

Source

pub fn seal(self) -> Result<Vec<u8>, Error>

Source

pub fn unseal(data: Vec<u8>) -> Result<Self, Error>

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<&Config> for Identity

Source§

fn from(config: &Config) -> Self

Converts to this type from the input type.
Source§

impl From<&Config> for SnowstormBehaviour

Source§

fn from(config: &Config) -> SnowstormBehaviour

Converts to this type from the input type.
Source§

impl From<&Config> for Toggle<Behaviour>

Source§

fn from(_config: &Config) -> Toggle<Behaviour>

Converts to this type from the input type.
Source§

impl From<&Config> for Toggle<Behaviour>

Source§

fn from(_config: &Config) -> Toggle<Behaviour>

Converts to this type from the input type.
Source§

impl From<&Config> for Toggle<Behaviour>

Source§

fn from(config: &Config) -> Toggle<Behaviour>

Converts to this type from the input type.
Source§

impl From<&Config> for Toggle<Behaviour>

Source§

fn from(config: &Config) -> Toggle<Behaviour>

Converts to this type from the input type.
Source§

impl From<&Config> for Toggle<Behaviour>

Source§

fn from(config: &Config) -> Toggle<Behaviour>

Converts to this type from the input type.
Source§

impl From<&Config> for Toggle<Behaviour>

Source§

fn from(config: &Config) -> Toggle<Behaviour>

Converts to this type from the input type.
Source§

impl From<&Config> for Vec<Namespace>

Source§

fn from(config: &Config) -> Self

Converts to this type from the input type.
Source§

impl From<Config> for SerializableConfig

Source§

fn from(config: Config) -> Self

Converts to this type from the input type.
Source§

impl From<SerializableConfig> for Config

Source§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for T
where T: Any + Clone + Send + Sync,

§

fn clone_any(&self) -> Box<dyn CloneAny>

§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send>

§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync>

§

fn clone_any_send_sync(&self) -> Box<dyn CloneAny + Sync + Send>

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DebugAny for T
where T: Any + Debug,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> UnsafeAny for T
where T: Any,