Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 16 fields pub server_id: SshId, pub methods: MethodSet, pub auth_rejection_time: Duration, pub auth_rejection_time_initial: Option<Duration>, pub keys: Vec<PrivateKey>, pub limits: Limits, pub window_size: u32, pub maximum_packet_size: u32, pub channel_buffer_size: usize, pub event_buffer_size: usize, pub preferred: Preferred, pub max_auth_attempts: usize, pub inactivity_timeout: Option<Duration>, pub keepalive_interval: Option<Duration>, pub keepalive_max: usize, pub nodelay: bool,
}
Expand description

Configuration of a server.

Fields§

§server_id: SshId

The server ID string sent at the beginning of the protocol.

§methods: MethodSet

Authentication methods proposed to the client.

§auth_rejection_time: Duration

Authentication rejections must happen in constant time for security reasons. Russh does not handle this by default.

§auth_rejection_time_initial: Option<Duration>

Authentication rejection time override for the initial “none” auth attempt. OpenSSH clients will send an initial “none” auth to probe for authentication methods.

§keys: Vec<PrivateKey>

The server’s keys. The first key pair in the client’s preference order will be chosen.

§limits: Limits

The bytes and time limits before key re-exchange.

§window_size: u32

The initial size of a channel (used for flow control).

§maximum_packet_size: u32

The maximal size of a single packet.

§channel_buffer_size: usize

Buffer size for each channel (a number of unprocessed messages to store before propagating backpressure to the TCP stream)

§event_buffer_size: usize

Internal event buffer size

§preferred: Preferred

Lists of preferred algorithms.

§max_auth_attempts: usize

Maximal number of allowed authentication attempts.

§inactivity_timeout: Option<Duration>

Time after which the connection is garbage-collected.

§keepalive_interval: Option<Duration>

If nothing is received from the client for this amount of time, send a keepalive message.

§keepalive_max: usize

If this many keepalives have been sent without reply, close the connection.

§nodelay: bool

If active, invoke set_nodelay(true) on client sockets; disabled by default (i.e. Nagle’s algorithm is active).

Trait Implementations§

Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Config

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

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

impl<T> Classify for T

Source§

type Classified = T

Source§

fn classify(self) -> T

Source§

impl<T> Declassify for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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

Source§

fn vzip(self) -> V