pub struct ComposerRepository {
pub url: String,
pub base_url: String,
pub options: Value,
pub cache: Option<MetadataCache>,
pub user_filter: Option<Vec<String>>,
/* private fields */
}Fields§
§url: String§base_url: String§options: Valueoptions of the repository definition (transport-options of the
packages whose dist URL is under base_url).
cache: Option<MetadataCache>Metadata cache in Composer’s format (cache-repo-dir).
user_filter: Option<Vec<String>>filter option of the repository definition: None = false (no
list), otherwise the disabled lists.
Implementations§
Source§impl ComposerRepository
impl ComposerRepository
Sourcepub fn open(
url: &str,
transport: Box<dyn Transport>,
) -> Result<ComposerRepository, RepoError>
pub fn open( url: &str, transport: Box<dyn Transport>, ) -> Result<ComposerRepository, RepoError>
Constructor (no reading: loadRootServerFile is lazy).
Sourcepub fn set_name_filter(
&mut self,
only: Option<&Value>,
exclude: Option<&Value>,
) -> Result<(), RepoError>
pub fn set_name_filter( &mut self, only: Option<&Value>, exclude: Option<&Value>, ) -> Result<(), RepoError>
FilterRepository::__construct: only or exclude (not both).
Sourcepub fn set_user_filter(&mut self, raw: Option<&Value>) -> Result<(), RepoError>
pub fn set_user_filter(&mut self, raw: Option<&Value>) -> Result<(), RepoError>
parseUserFilterConfig of the repository’s filter option.
pub fn notify_url(&self) -> Result<Option<String>, RepoError>
pub fn lazy_providers_url(&self) -> Result<Option<String>, RepoError>
Sourcepub fn providers_api(
&self,
package_name: &str,
) -> Result<Option<Providers>, RepoError>
pub fn providers_api( &self, package_name: &str, ) -> Result<Option<Providers>, RepoError>
getProviders through the providers-api of packages.json:
None when the repository declares none (the caller then walks
the loaded packages), Some(list) otherwise — (name, description)
entries, empty on 404.
Sourcepub fn provider_candidates(
&self,
origin: Origin,
arena: &mut Vec<Package>,
) -> Result<Vec<usize>, RepoError>
pub fn provider_candidates( &self, origin: Origin, arena: &mut Vec<Package>, ) -> Result<Vec<usize>, RepoError>
The packages getProviders walks without the providers API: the
partial packages of packages.json (every version, every stability)
and the plain packages list (parent::getProviders over
getPackages()). Empty for a lazy p2-only repository.
Sourcepub fn has_security_advisories(&self) -> Result<bool, RepoError>
pub fn has_security_advisories(&self) -> Result<bool, RepoError>
hasSecurityAdvisories.
Sourcepub fn get_security_advisories(
&self,
map: &[(String, Constraint)],
allow_partial: bool,
) -> Result<(Vec<String>, AdvisoriesByName), RepoError>
pub fn get_security_advisories( &self, map: &[(String, Constraint)], allow_partial: bool, ) -> Result<(Vec<String>, AdvisoriesByName), RepoError>
getSecurityAdvisories: advisories by name for the requested
constraints: metadata path (p2 files, partial advisories) then API
(POST) for what remains. allow_partial false = complete load
required (error if an embedded advisory is only partial and no API
can complete it).
Sourcepub fn get_filter_lists(&self) -> Result<Vec<String>, RepoError>
pub fn get_filter_lists(&self) -> Result<Vec<String>, RepoError>
hasFilter / getFilterLists: the advertised lists, minus those
the repository’s filter option disables.
Sourcepub fn get_filter(
&self,
map: &[(String, Constraint)],
configured_lists: &[String],
) -> Result<FilterEntriesByList, RepoError>
pub fn get_filter( &self, map: &[(String, Constraint)], configured_lists: &[String], ) -> Result<FilterEntriesByList, RepoError>
getFilter: the list entries for the requested constraints: API
(not ported: error), otherwise summary then p2 files of the
candidates, otherwise p2 files of all names.
Sourcepub fn load_packages(
&self,
package_name_map: &[(String, Constraint)],
acceptable: &BTreeMap<String, i32>,
flags: &BTreeMap<String, i32>,
already_loaded: &BTreeMap<String, BTreeSet<String>>,
origin: Origin,
arena: &mut Vec<Package>,
) -> Result<(Vec<String>, Vec<usize>), RepoError>
pub fn load_packages( &self, package_name_map: &[(String, Constraint)], acceptable: &BTreeMap<String, i32>, flags: &BTreeMap<String, i32>, already_loaded: &BTreeMap<String, BTreeSet<String>>, origin: Origin, arena: &mut Vec<Package>, ) -> Result<(Vec<String>, Vec<usize>), RepoError>
loadPackages: inline packages first (whatProvides), then the v2
path (loadAsyncPackages). Returns (namesFound, ids);
already_loaded: name -> normalized versions already in the pool
for this repository.
Auto Trait Implementations§
impl !Freeze for ComposerRepository
impl !RefUnwindSafe for ComposerRepository
impl !Send for ComposerRepository
impl !Sync for ComposerRepository
impl !UnwindSafe for ComposerRepository
impl Unpin for ComposerRepository
impl UnsafeUnpin for ComposerRepository
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
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> ⓘ
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> ⓘ
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