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