Skip to main content

Adapters

Struct Adapters 

Source
pub(crate) struct Adapters<R, N> {
    cargo: CargoAdapter<R>,
    npm: NpmPublisher<N>,
}
Expand description

Every supported ecosystem adapter, dispatching units by target kind.

Fields§

§cargo: CargoAdapter<R>§npm: NpmPublisher<N>

Implementations§

Source§

impl<R, N> Adapters<R, N>

Source

pub(crate) const fn new(cargo_registry: R, npm_registry: Option<N>) -> Self

Bind the Cargo registry and the npm registry, when one is configured.

Source§

impl<R, N> Adapters<R, N>

Source

pub(crate) fn authenticated( self, cargo_authorization: Token, npm_token: Token, ) -> Self

Publish Cargo crates with cargo_authorization as the whole Authorization value and npm packages with npm_token.

Source§

impl Adapters<NoRegistry, NoRegistry>

Source

pub(crate) const fn without_registry() -> Self

Adapters for discovery and planning, which never publish.

Source§

impl<R, N> Adapters<R, N>

Source

pub(crate) fn resolve( &self, root: &RepositoryRoot, configured: &BTreeMap<String, ReleaseUnitState>, ) -> Result<Vec<Unit>, ResolveError>

Units of every ecosystem from the configured release units.

Source

pub(crate) fn complete_versions( &self, root: &RepositoryRoot, units: &[Unit], explicit: &BTreeMap<String, Version>, automatic: &BTreeMap<String, Version>, ) -> Result<BTreeMap<String, Version>, ResolveError>

Fan explicit and automatic version proposals out to whatever grouping the ecosystem has. Explicit targets win over automatic ones.

Source

pub(crate) fn plan_edits( &self, root: &RepositoryRoot, units: &[Unit], versions: &BTreeMap<String, Proposed>, context: &EditContext<'_>, edits: &mut PlannedEdits, ) -> Result<(), ResolveError>

Plan the edits for the proposed units, contributing to the shared transaction. The requirement changes need no consumer check here, see Adapters::check_consumers. entries holds the changelog entries by unit.

Source

pub(crate) fn plan_pin_edits<B: AssetBuilder>( root: &RepositoryRoot, units: &[Unit], released_now: &BTreeMap<String, Proposed>, builder: &B, worktree: &Path, edits: &mut PlannedEdits, ) -> Result<(), ResolveError>

Write the new version and the asset digests of the released dependencies into the units that pin them. The assets are built from worktree, so the edits of the dependencies must be applied first.

Source

pub(crate) fn check_consumers( &self, root: &RepositoryRoot, units: &[Unit], versions: &BTreeMap<String, Proposed>, ) -> Result<(), ResolveError>

Reject proposals that change a dependency entry for consumers without a proposal.

Source

pub(crate) fn shared_groups( &self, root: &RepositoryRoot, units: &[Unit], ) -> Result<Vec<BTreeSet<String>>, ResolveError>

Groups of units that cannot be released apart.

Source

pub(crate) fn reload(&self)

Read workspace files again after they changed on disk.

Source

pub(crate) fn local_plan( &self, root: &RepositoryRoot, units: &[Unit], unit: &Unit, target_version: &Version, date: &str, ) -> Result<LocalPlan, ResolveError>

Plan a local release of unit; units are all resolved units.

Source§

impl<R, N> Adapters<R, N>

Source

pub(crate) fn prepare( worktree: &RepositoryRoot, units: &[Unit], ) -> Result<Vec<PathBuf>, ResolveError>

Refresh generated files in a proposal worktree after its edits are applied, returning repository paths that need staging. Callers must run this after writing proposed manifest changes, so a generated file such as a lockfile reflects the bumped versions.

Source

fn partition(units: &[Unit]) -> (Vec<&Unit>, Vec<Placed<'_, Unit, Holder<'_>>>)

Source

fn select<V: Clone>( versions: &BTreeMap<String, V>, names: &BTreeSet<&str>, ) -> BTreeMap<String, V>

Trait Implementations§

Source§

impl<R: Debug, N: Debug> Debug for Adapters<R, N>

Source§

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

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

impl<R: PackageRegistry, N: PackageRegistry> PackagePublisher for Adapters<R, N>

Source§

type Error = ResolveError

The failure of a package lookup or upload.
Source§

async fn is_published(&self, unit: &Unit) -> Result<bool, Self::Error>

Whether the unit’s version already exists where it is published.
Source§

async fn publish(&self, unit: &Unit, file: &Path) -> Result<(), Self::Error>

Publish one unit’s staged package file.

Auto Trait Implementations§

§

impl<R, N> !Freeze for Adapters<R, N>

§

impl<R, N> !RefUnwindSafe for Adapters<R, N>

§

impl<R, N> !Send for Adapters<R, N>

§

impl<R, N> !Sync for Adapters<R, N>

§

impl<R, N> Unpin for Adapters<R, N>

§

impl<R, N> UnsafeUnpin for Adapters<R, N>

§

impl<R, N> UnwindSafe for Adapters<R, N>

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. 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 = !

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

impl<T> WithSubscriber for T

§

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
§

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

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