[][src]Struct cargo::core::source::SourceMap

pub struct SourceMap<'src> { /* fields omitted */ }

A HashMap of SourceId -> Box<Source>.

Implementations

impl<'src> SourceMap<'src>[src]

pub fn new() -> SourceMap<'src>[src]

Creates an empty map.

pub fn contains(&self, id: SourceId) -> bool[src]

Like HashMap::contains_key.

pub fn get(&self, id: SourceId) -> Option<&(dyn Source + 'src)>[src]

Like HashMap::get.

pub fn get_mut(&mut self, id: SourceId) -> Option<&mut (dyn Source + 'src)>[src]

Like HashMap::get_mut.

pub fn get_by_package_id(
    &self,
    pkg_id: PackageId
) -> Option<&(dyn Source + 'src)>
[src]

Like HashMap::get, but first calculates the SourceId from a PackageId.

pub fn insert(&mut self, source: Box<dyn Source + 'src>)[src]

Like HashMap::insert, but derives the SourceId key from the Source.

pub fn is_empty(&self) -> bool[src]

Like HashMap::is_empty.

pub fn len(&self) -> usize[src]

Like HashMap::len.

pub fn sources<'a>(&'a self) -> impl Iterator<Item = &'a Box<dyn Source + 'src>>[src]

Like HashMap::values.

pub fn sources_mut<'a>(
    &'a mut self
) -> impl Iterator<Item = (&'a SourceId, &'a mut (dyn Source + 'src))>
[src]

Like HashMap::iter_mut.

pub fn add_source_map(&mut self, other: SourceMap<'src>)[src]

Merge the given map into self.

Trait Implementations

impl<'src> Debug for SourceMap<'src>[src]

impl<'src> Default for SourceMap<'src>[src]

Auto Trait Implementations

impl<'src> !RefUnwindSafe for SourceMap<'src>

impl<'src> !Send for SourceMap<'src>

impl<'src> !Sync for SourceMap<'src>

impl<'src> Unpin for SourceMap<'src>

impl<'src> !UnwindSafe for SourceMap<'src>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,