Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub agent: String,
    pub offered: Offered,
    pub want_policy: WantPolicy,
    pub budget: Option<usize>,
    pub limits: Limits,
    pub walk_pool: Option<Arc<WalkPool>>,
}
Expand description

Knobs the SSH layer sets per connection.

Fields§

§agent: String

The agent= string. Defaults to gunnar/<version>.

§offered: Offered

Which optional v2 features are on offer.

§want_policy: WantPolicy

Which object ids a client may want.

§budget: Option<usize>

An operator’s explicit cap on the objects one traversal may hold.

None by default, and that is not a guard left off. Limits::walk_bytes is the ceiling that ships, in bytes, and this is --fetch-budget for an operator who wants a second one in objects.

It used to default to crate::DEFAULT_BUDGET, and leaving it there would have made the byte ceiling decorative: MEASURED 2026-08-05, ten million objects refuses a clone of a 14 042 000-object repository that the same machine serves in 5.59 GB, so the object cap and not the memory would still have been what decided.

See crate::DEFAULT_BUDGET for why the unit was wrong and limits for the ceilings that are about bytes.

§limits: Limits

The memory ceilings this connection serves under.

Defaults to Limits::default, which is every ceiling on. See limits.

§walk_pool: Option<Arc<WalkPool>>

The server-wide purse this connection’s traversals spend from.

None by default, and this is the one field where that is not a guard left off. A pool is shared state between connections, so it can only be created by whatever owns them all: gunnar serve builds one sized to the machine and hands the same Arc to every session. A Config built by hand — a test, gunnar mirror, an embedding — has no siblings to share with, and giving it a private pool of its own would be a ceiling that bounds nothing while reading as if it did.

Limits::walk_bytes is the per-request half and is on by default. See WalkPool for why one without the other is not a bound on the server.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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

Auto Trait Implementations§

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> 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.

Source§

impl<T> Instrument for T

Source§

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

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

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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