Skip to main content

GitwayConfig

Struct GitwayConfig 

Source
pub struct GitwayConfig {
    pub host: String,
    pub port: u16,
    pub username: String,
    pub identity_file: Option<PathBuf>,
    pub cert_file: Option<PathBuf>,
    pub skip_host_check: bool,
    pub inactivity_timeout: Duration,
    pub custom_known_hosts: Option<PathBuf>,
    pub verbose: bool,
    pub fallback: Option<(String, u16)>,
}
Expand description

Immutable configuration for a GitwaySession.

Construct via GitwayConfig::builder, or use one of the convenience constructors (github, gitlab, codeberg) for the most common targets.

Fields§

§host: String

Primary SSH host (e.g. github.com, gitlab.com, codeberg.org).

§port: u16

Primary SSH port (default: 22).

§username: String

Remote username (always git for hosted services; FR-13).

§identity_file: Option<PathBuf>

Explicit identity file path supplied via --identity.

§cert_file: Option<PathBuf>

OpenSSH certificate path supplied via --cert.

§skip_host_check: bool

When true, skip host-key verification (FR-8).

§inactivity_timeout: Duration

Inactivity timeout for the SSH session (FR-5).

GitHub’s idle threshold is around 60 s; this is the configured client-side inactivity timeout, not a per-packet deadline.

§custom_known_hosts: Option<PathBuf>

Path to a known_hosts-style file for custom or self-hosted instances (FR-7). Format: one hostname SHA256:<fp> entry per line.

§verbose: bool

Enable verbose debug logging when true.

§fallback: Option<(String, u16)>

Optional fallback host when port 22 is unavailable (FR-1).

GitHub: ssh.github.com:443. GitLab: altssh.gitlab.com:443. Codeberg has no published port-443 fallback.

Implementations§

Source§

impl GitwayConfig

Source

pub fn builder(host: impl Into<String>) -> GitwayConfigBuilder

Begin building a config targeting host.

All optional fields default to sensible values. No fallback host is set by default; use the provider-specific convenience constructors (github, gitlab) if you want the port-443 fallback pre-configured.

Source

pub fn github() -> Self

Convenience constructor for the default GitHub target (github.com:22).

Includes the ssh.github.com:443 fallback pre-configured.

Source

pub fn gitlab() -> Self

Convenience constructor for the default GitLab target (gitlab.com:22).

Includes the altssh.gitlab.com:443 fallback pre-configured.

Source

pub fn codeberg() -> Self

Convenience constructor for Codeberg (codeberg.org:22).

Codeberg has no published port-443 SSH fallback; no fallback is set.

Trait Implementations§

Source§

impl Clone for GitwayConfig

Source§

fn clone(&self) -> GitwayConfig

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 GitwayConfig

Source§

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

Formats the value using the given formatter. 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, 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 = 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