rustc_metadata::rmeta::decoder

Trait Metadata

Source
pub(super) trait Metadata<'a, 'tcx>: Copy {
    // Required method
    fn blob(self) -> &'a MetadataBlob;

    // Provided methods
    fn cdata(self) -> Option<CrateMetadataRef<'a>> { ... }
    fn sess(self) -> Option<&'tcx Session> { ... }
    fn tcx(self) -> Option<TyCtxt<'tcx>> { ... }
    fn decoder(self, pos: usize) -> DecodeContext<'a, 'tcx> { ... }
}
Expand description

Abstract over the various ways one can create metadata decoders.

Required Methods§

Source

fn blob(self) -> &'a MetadataBlob

Provided Methods§

Source

fn cdata(self) -> Option<CrateMetadataRef<'a>>

Source

fn sess(self) -> Option<&'tcx Session>

Source

fn tcx(self) -> Option<TyCtxt<'tcx>>

Source

fn decoder(self, pos: usize) -> DecodeContext<'a, 'tcx>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a MetadataBlob, &'tcx Session)

Source§

fn blob(self) -> &'a MetadataBlob

Source§

fn sess(self) -> Option<&'tcx Session>

Source§

impl<'a, 'tcx> Metadata<'a, 'tcx> for (CrateMetadataRef<'a>, &'tcx Session)

Source§

fn blob(self) -> &'a MetadataBlob

Source§

fn cdata(self) -> Option<CrateMetadataRef<'a>>

Source§

fn sess(self) -> Option<&'tcx Session>

Source§

impl<'a, 'tcx> Metadata<'a, 'tcx> for (CrateMetadataRef<'a>, TyCtxt<'tcx>)

Source§

fn blob(self) -> &'a MetadataBlob

Source§

fn cdata(self) -> Option<CrateMetadataRef<'a>>

Source§

fn tcx(self) -> Option<TyCtxt<'tcx>>

Implementors§

Source§

impl<'a, 'tcx> Metadata<'a, 'tcx> for &'a MetadataBlob

Source§

impl<'a, 'tcx> Metadata<'a, 'tcx> for CrateMetadataRef<'a>