Skip to main content

LfsAccess

Struct LfsAccess 

Source
pub struct LfsAccess {
    pub store: Arc<dyn LfsStore>,
    pub limits: Limits,
    pub allowance: Option<NamespaceAllowance>,
}
Expand description

An authorised repository’s LFS object store, and what it will accept.

Returned by LfsTransport::open_lfs, and deliberately not a session: LFS over HTTP is four independent requests (batch, GET, PUT, verify), each authorised on its own, so there is nothing for a session to hold between them. What the two surfaces share is the store and the limits, which is exactly what this carries.

Fields§

§store: Arc<dyn LfsStore>

Where the objects are. Arc because the caller runs the actual I/O on a blocking thread and has to own it there.

§limits: Limits

The quota and the batch cap in force, from the same WireConfig::lfs the SSH session is built with. A second home for these is how 8 GiB comes to be enforced on one transport and not the other.

§allowance: Option<NamespaceAllowance>

The tenant’s remaining LFS room, decided by the same crate::PlanGate chain that decided crate::ServiceRequest::pack_ceiling for a push, and None wherever a push would get no ceiling: a community build, an uncapped namespace, a download.

Beside Self::limits rather than inside it because they are different kinds of number. limits is the operator’s, one set for the whole box, Copy, and comes off the command line; this is one namespace’s plan, re-measured per transfer, and carries a sentence built from a signed entitlement fact. A tenant who fills it is told to buy more; a client that trips limits is told the box does not take objects that big.

Trait Implementations§

Source§

impl Debug for LfsAccess

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