pub struct CodeGraph { /* private fields */ }Implementations§
Source§impl CodeGraph
impl CodeGraph
pub fn from_records(defs: Vec<DefRecord>, refs: Vec<RefRecord>) -> Self
pub fn new(root: Moniker, root_kind: &[u8]) -> Self
pub fn with_capacity( root: Moniker, root_kind: &[u8], def_cap: usize, ref_cap: usize, ) -> Self
pub fn capacity_for_source(source_len: usize) -> (usize, usize)
pub fn add_def( &mut self, moniker: Moniker, kind: &[u8], parent: &Moniker, position: Option<Position>, ) -> Result<(), GraphError>
pub fn add_def_attrs( &mut self, moniker: Moniker, kind: &[u8], parent: &Moniker, position: Option<Position>, attrs: &DefAttrs<'_>, ) -> Result<(), GraphError>
pub fn add_ref( &mut self, source: &Moniker, target: Moniker, kind: &[u8], position: Option<Position>, ) -> Result<(), GraphError>
pub fn add_ref_attrs( &mut self, source: &Moniker, target: Moniker, kind: &[u8], position: Option<Position>, attrs: &RefAttrs<'_>, ) -> Result<(), GraphError>
pub fn root(&self) -> &Moniker
pub fn contains(&self, m: &Moniker) -> bool
pub fn defs(&self) -> impl Iterator<Item = &DefRecord>
pub fn def_at(&self, i: usize) -> &DefRecord
pub fn refs(&self) -> impl Iterator<Item = &RefRecord>
pub fn ref_at(&self, i: usize) -> &RefRecord
pub fn locate(&self, m: &Moniker) -> Option<Position>
pub fn def_monikers(&self) -> Arc<Vec<Moniker>>
pub fn ref_targets(&self) -> Arc<Vec<Moniker>>
pub fn def_count(&self) -> usize
pub fn ref_count(&self) -> usize
Trait Implementations§
impl Eq for CodeGraph
Auto Trait Implementations§
impl !Freeze for CodeGraph
impl !RefUnwindSafe for CodeGraph
impl Send for CodeGraph
impl !Sync for CodeGraph
impl Unpin for CodeGraph
impl UnsafeUnpin for CodeGraph
impl UnwindSafe for CodeGraph
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
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.