Skip to main content

WireTransport

Struct WireTransport 

Source
pub struct WireTransport { /* private fields */ }
Expand description

gunnar-wire, wired to the SSH listener.

Implementations§

Source§

impl WireTransport

Source

pub fn new(stores: Arc<ServerStores>) -> Self

Serve repositories out of stores.

Source

pub fn with_wire_config(self, wire: WireConfig) -> Self

Serve under wire rather than gunnar-wire’s defaults.

The whole of what makes WireConfig reachable. Without a call to this, every knob on it is a comment.

Source

pub fn with_metrics(self, metrics: Arc<ServerMetrics>) -> Self

Count into the server’s counters rather than into a private set.

gunnar serve mints one ServerMetrics and hands the same Arc here and to the SSH listener, so connections_refused and pushes_rejected are two readings of one server. A transport built without this still counts, into a set only it can see, which is what a unit test wants.

Source

pub fn with_bus(self, bus: Arc<EventBus>) -> Self

Publish RefUpdated / RefDeleted / PushRejected / PushAttestation to the event bus.

The bus is optional; the attestation log is not. A server started with --no-grpc has nobody to notify, but the attestation’s durable record is not a notification. It is the thing the event stream explicitly does not promise to keep (see EventBus::publish), so the log is written either way and only the publish is conditional.

Source

pub fn attestation_log(&self) -> &AttestationLog

Where the attestation’s JSON lines land.

Trait Implementations§

Source§

impl GitTransport for WireTransport

Source§

fn serve<'a>( &'a self, request: ServiceRequest, stream: Box<dyn DuplexStream>, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'a>>

Serve one request to completion.
Source§

impl LfsTransport for WireTransport

The LFS object store, opened the one way — for the SSH session and for the HTTP batch API alike (one implementation).

The two surfaces used to be one call apart from having two answers to where does this repository keep its LFS objects: serve_blocking reached for stores.repo_store(...).git_dir() and anything else would have had to re-derive it. It is <git_dir>/lfs/, the symlink check in ServerStores::repo_dir is not optional on either path, and the handle the store lock lives on is the same handle, so a repack and an LFS transfer exclude each other the same way on both transports.

Source§

fn open_lfs( &self, request: &ServiceRequest, ) -> Result<LfsAccess, TransportError>

The object store for request’s repository.

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

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

Source§

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

Source§

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

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