pub struct CrateReference {
pub name: String,
pub features: HashSet<String>,
pub used_in: HashSet<PathBuf>,
pub is_path_dependency: bool,
pub path: Option<String>,
pub publish: Option<bool>,
}Expand description
A reference to a crate and its usage within the project
Fields§
§name: StringName of the crate
features: HashSet<String>Set of features used by this crate
used_in: HashSet<PathBuf>Set of file paths where this crate is used
is_path_dependency: boolWhether this crate is a path dependency (internal crate)
path: Option<String>Path to the internal crate if it’s a path dependency
publish: Option<bool>Whether this crate is marked as not publishable
Implementations§
Source§impl CrateReference
impl CrateReference
pub fn new(name: String) -> Self
pub fn with_path(name: String, path: String) -> Self
pub fn add_usage(&mut self, path: PathBuf)
pub fn add_feature(&mut self, feature: String)
pub fn usage_count(&self) -> usize
pub fn set_as_path_dependency(&mut self, path: String)
pub fn set_publish(&mut self, publish: bool)
Trait Implementations§
Source§impl Clone for CrateReference
impl Clone for CrateReference
Source§fn clone(&self) -> CrateReference
fn clone(&self) -> CrateReference
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CrateReference
impl RefUnwindSafe for CrateReference
impl Send for CrateReference
impl Sync for CrateReference
impl Unpin for CrateReference
impl UnwindSafe for CrateReference
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