pub struct ProfiledDriverIdentity { /* private fields */ }Expand description
Identity of a driver whose installed loader version can be recovered from version JSON metadata.
To support a new driver:
- Set
descriptorto the driver’sDriverDescriptor. - Put Maven coordinates that only appear when the loader is installed in
markers. If the loader leaves no such library behind, matching falls back to the profile id shape. - Put the coordinates that carry the installed loader version in
version_libraries. Coordinates that merely prove the loader is present must stay inmarkers, not here. - Describe the profile id with
ProfileIdPattern: useProfileIdPattern::newfor<game><separator><loader>ids andProfileIdPattern::loader_prefixedfor<prefix><loader>ids. - Add
with_stale_markerswhen a legacy coordinate must force a metadata refresh.
Version lookup prefers version_libraries and falls back to the profile id.
The shared installer/version-json inspection path consumes this identity
directly, so a driver does not need to override inspect_installed.
Implementations§
Source§impl ProfiledDriverIdentity
impl ProfiledDriverIdentity
pub const fn new( descriptor: DriverDescriptor, markers: LibraryPrefixSet, version_libraries: LibraryPrefixSet, profile_id: ProfileIdPattern, ) -> Self
pub const fn with_stale_markers(self, stale_markers: LibraryPrefixSet) -> Self
pub fn descriptor(self) -> DriverDescriptor
pub fn build_profile_id( self, game_version: &str, loader_version: &str, ) -> String
pub fn inspect_driver_version(self, metadata: &PistonMetaData) -> Option<String>
pub fn matches_metadata(self, metadata: &PistonMetaData) -> bool
pub fn local_metadata_needs_refresh( self, metadata: &PistonMetaData, game_version: &MinecraftVersionId, loader_version: &str, ) -> bool
pub fn inspect_installed( self, metadata: &PistonMetaData, ) -> Option<InstalledDriver>
Trait Implementations§
Source§impl Clone for ProfiledDriverIdentity
impl Clone for ProfiledDriverIdentity
impl Copy for ProfiledDriverIdentity
Source§impl Debug for ProfiledDriverIdentity
impl Debug for ProfiledDriverIdentity
impl Eq for ProfiledDriverIdentity
Source§impl PartialEq for ProfiledDriverIdentity
impl PartialEq for ProfiledDriverIdentity
impl StructuralPartialEq for ProfiledDriverIdentity
Auto Trait Implementations§
impl Forget for ProfiledDriverIdentity
impl Freeze for ProfiledDriverIdentity
impl Move for ProfiledDriverIdentity
impl RefUnwindSafe for ProfiledDriverIdentity
impl Send for ProfiledDriverIdentity
impl Sync for ProfiledDriverIdentity
impl Unpin for ProfiledDriverIdentity
impl UnsafeUnpin for ProfiledDriverIdentity
impl UnwindSafe for ProfiledDriverIdentity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self with key and returns true if they are equal.