pub struct Updater { /* private fields */ }Expand description
Rewrites flake.nix URIs for update, pin, and unpin.
Owns one ForgeClient for the lifetime of the updater so the
inner forge fetches share a single HTTP agent and memoize repeats
across all inputs in one pass.
Implementations§
Source§impl Updater
impl Updater
Sourcepub fn new(text: Rope, map: InputMap) -> Self
pub fn new(text: Rope, map: InputMap) -> Self
Build an Updater from text and the inputs in map. Inputs
without an editable URL are skipped.
pub fn update_all_to_latest_semver(&mut self, init: bool)
Sourcepub fn update_inputs_to_latest_semver(&mut self, ids: &[&str], init: bool)
pub fn update_inputs_to_latest_semver(&mut self, ids: &[&str], init: bool)
Update only the inputs whose id appears in ids.
IDs that do not name an editable input are silently skipped, the same way the all-inputs path skips inputs without an editable URL. Duplicates collapse: each matching input is processed at most once.
Sourcepub fn get_changes(&self) -> String
pub fn get_changes(&self) -> String
Current source after all queued edits.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Updater
impl !RefUnwindSafe for Updater
impl !UnwindSafe for Updater
impl Send for Updater
impl Sync for Updater
impl Unpin for Updater
impl UnsafeUnpin for Updater
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more