pub struct ExtractUnsafeApis<'tcx> {
tcx: TyCtxt<'tcx>,
}Fields§
§tcx: TyCtxt<'tcx>Implementations§
Source§impl<'tcx> ExtractUnsafeApis<'tcx>
impl<'tcx> ExtractUnsafeApis<'tcx>
pub fn new(tcx: TyCtxt<'tcx>) -> Self
Sourcefn get_doc_string(&self, def_id: DefId) -> String
fn get_doc_string(&self, def_id: DefId) -> String
Collect doc comment text for a def_id by joining all #[doc = "..."] attrs.
Sourcefn get_safety_doc(&self, def_id: DefId) -> Option<String>
fn get_safety_doc(&self, def_id: DefId) -> Option<String>
Extract the # Safety section from the doc comment of a def_id.
Sourcefn get_params(&self, def_id: DefId) -> Vec<ParamInfo>
fn get_params(&self, def_id: DefId) -> Vec<ParamInfo>
Get parameter types from the function signature.
Sourcefn get_hir_param_names(&self, def_id: DefId) -> Vec<String>
fn get_hir_param_names(&self, def_id: DefId) -> Vec<String>
Attempt to retrieve parameter names from the HIR body for a local function.
Sourcefn make_entry(&self, def_id: DefId) -> UnsafeApiEntry
fn make_entry(&self, def_id: DefId) -> UnsafeApiEntry
Build an UnsafeApiEntry from a DefId.
Sourcefn collect_local(&self) -> Vec<UnsafeApiEntry>
fn collect_local(&self) -> Vec<UnsafeApiEntry>
Collect all public unsafe fn and AssocFn items in the local crate.
Sourcefn collect_std(&self) -> Vec<UnsafeApiEntry>
fn collect_std(&self) -> Vec<UnsafeApiEntry>
Collect all public unsafe functions from the Rust standard library.
Auto Trait Implementations§
impl<'tcx> Freeze for ExtractUnsafeApis<'tcx>
impl<'tcx> !RefUnwindSafe for ExtractUnsafeApis<'tcx>
impl<'tcx> !Send for ExtractUnsafeApis<'tcx>
impl<'tcx> !Sync for ExtractUnsafeApis<'tcx>
impl<'tcx> Unpin for ExtractUnsafeApis<'tcx>
impl<'tcx> !UnwindSafe for ExtractUnsafeApis<'tcx>
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> 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