pub struct UpdateManager {
pub settings: UpdateSettings,
pub core: Later<MCVMCore>,
pub version_info: Later<VersionInfo>,
/* private fields */
}
Expand description
Manager for when we are updating profile files. It will keep track of files we have already downloaded, manage task requirements, etc
Fields§
§settings: UpdateSettings
Settings for the update
core: Later<MCVMCore>
The core to be fulfilled later
version_info: Later<VersionInfo>
The version info to be fulfilled later
Implementations§
Source§impl UpdateManager
impl UpdateManager
Sourcepub fn new(depth: UpdateDepth) -> Self
pub fn new(depth: UpdateDepth) -> Self
Create a new UpdateManager
Sourcepub fn offline_auth(&mut self)
pub fn offline_auth(&mut self)
Set offline authentication
Sourcepub fn set_client_id(&mut self, id: ClientId)
pub fn set_client_id(&mut self, id: ClientId)
Set the MS client ID
Sourcepub fn add_requirement(&mut self, req: UpdateRequirement)
pub fn add_requirement(&mut self, req: UpdateRequirement)
Add a single requirement
Sourcepub fn add_requirements(&mut self, reqs: HashSet<UpdateRequirement>)
pub fn add_requirements(&mut self, reqs: HashSet<UpdateRequirement>)
Add multiple requirements
Sourcepub fn has_requirement(&self, req: UpdateRequirement) -> bool
pub fn has_requirement(&self, req: UpdateRequirement) -> bool
Check if a requirement is held
Sourcepub fn add_result(&mut self, result: UpdateMethodResult)
pub fn add_result(&mut self, result: UpdateMethodResult)
Adds an UpdateMethodResult to the UpdateManager
Sourcepub fn should_update_file(&self, file: &Path) -> bool
pub fn should_update_file(&self, file: &Path) -> bool
Whether a file needs to be updated
Sourcepub fn set_version(&mut self, version: &MinecraftVersion)
pub fn set_version(&mut self, version: &MinecraftVersion)
Set the Minecraft version. Can be used with the same UpdateManager and will work fine. Just make sure to fulfill requirements again.
Sourcepub async fn fulfill_requirements(
&mut self,
users: &UserManager,
plugins: &PluginManager,
paths: &Paths,
client: &Client,
o: &mut impl MCVMOutput,
) -> Result<()>
pub async fn fulfill_requirements( &mut self, users: &UserManager, plugins: &PluginManager, paths: &Paths, client: &Client, o: &mut impl MCVMOutput, ) -> Result<()>
Run all of the operations that are part of the requirements.
Sourcepub async fn get_core_version(
&mut self,
o: &mut impl MCVMOutput,
) -> Result<InstalledVersion<'_, '_>>
pub async fn get_core_version( &mut self, o: &mut impl MCVMOutput, ) -> Result<InstalledVersion<'_, '_>>
Get the version from the core
Auto Trait Implementations§
impl Freeze for UpdateManager
impl !RefUnwindSafe for UpdateManager
impl Send for UpdateManager
impl Sync for UpdateManager
impl Unpin for UpdateManager
impl !UnwindSafe for UpdateManager
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