pub struct BlockFunc<'blk> {
pub base: BlockBase<'blk>,
pub name: String,
pub parameters: RwLock<Vec<BlockId>>,
pub returns: RwLock<Option<BlockId>>,
pub type_deps: RwLock<HashSet<BlockId>>,
pub func_deps: RwLock<HashSet<BlockId>>,
pub is_method: AtomicBool,
}Fields§
§base: BlockBase<'blk>§name: String§parameters: RwLock<Vec<BlockId>>§returns: RwLock<Option<BlockId>>§type_deps: RwLock<HashSet<BlockId>>Types used inside function body (excludes parameter/return types) Examples: local variable types, static method receivers (Foo::method)
func_deps: RwLock<HashSet<BlockId>>Functions/methods called by this function
is_method: AtomicBoolWhether this is a method (inside impl block) vs a free function
Implementations§
Source§impl<'blk> BlockFunc<'blk>
impl<'blk> BlockFunc<'blk>
pub fn new( id: BlockId, node: HirNode<'blk>, kind: BlockKind, parent: Option<BlockId>, children: Vec<BlockId>, ) -> Self
pub fn new_with_symbol( id: BlockId, node: HirNode<'blk>, kind: BlockKind, parent: Option<BlockId>, children: Vec<BlockId>, symbol: Option<&'blk Symbol>, ) -> Self
pub fn set_is_method(&self, is_method: bool)
pub fn is_method(&self) -> bool
pub fn add_parameter(&self, param: BlockId)
pub fn get_parameters(&self) -> Vec<BlockId>
pub fn set_returns(&self, ret: BlockId)
pub fn get_returns(&self) -> Option<BlockId>
pub fn add_type_dep(&self, type_id: BlockId)
pub fn get_type_deps(&self) -> HashSet<BlockId>
pub fn add_func_dep(&self, func_id: BlockId)
pub fn get_func_deps(&self) -> HashSet<BlockId>
pub fn format(&self, _unit: CompileUnit<'blk>) -> String
Sourcepub fn format_deps(&self, unit: CompileUnit<'blk>) -> Vec<String>
pub fn format_deps(&self, unit: CompileUnit<'blk>) -> Vec<String>
Format dependency entries as pseudo-children (to be rendered after real children) Returns lines like “@tdep:3 Bar” and “@fdep:5 process”
Trait Implementations§
Source§impl<'a> ArenaInsert<'a> for BlockFunc<'a>
impl<'a> ArenaInsert<'a> for BlockFunc<'a>
fn insert_into(self, arena: &'a ArenaInner) -> &'a Self
Source§impl<'a> ArenaInsertWithId<'a> for BlockFunc<'a>
impl<'a> ArenaInsertWithId<'a> for BlockFunc<'a>
fn insert_with_id(self, arena: &'a ArenaInner, id: usize) -> &'a Self
Auto Trait Implementations§
impl<'blk> !Freeze for BlockFunc<'blk>
impl<'blk> !RefUnwindSafe for BlockFunc<'blk>
impl<'blk> Send for BlockFunc<'blk>
impl<'blk> Sync for BlockFunc<'blk>
impl<'blk> Unpin for BlockFunc<'blk>
impl<'blk> !UnwindSafe for BlockFunc<'blk>
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> 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>
Converts
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>
Converts
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