Struct rustc_metadata::schema::Lazy [−][src]
#[must_use]pub struct Lazy<T> { pub position: usize, _marker: PhantomData<T>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A value of type T referred to by its absolute position in the metadata, and which can be decoded lazily.
Metadata is effective a tree, encoded in post-order,
and with the root's position written next to the header.
That means every single Lazy
points to some previous
location in the metadata and is part of a larger node.
The first Lazy
in a node is encoded as the backwards
distance from the position where the containing node
starts and where the Lazy
points to, while the rest
use the forward distance from the previous Lazy
.
Distances start at 1, as 0-byte nodes are invalid.
Also invalid are nodes being referred in a different
order than they were encoded in.
Fields
position: usize
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
_marker: PhantomData<T>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a, 'tcx: 'a, T: Decodable> Lazy<T>
[src]
impl<'a, 'tcx: 'a, T: Decodable> Lazy<T>
pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> T
[src]
pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> T
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<T> Lazy<T>
[src]
impl<T> Lazy<T>
pub fn with_position(position: usize) -> Lazy<T>
[src]
pub fn with_position(position: usize) -> Lazy<T>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn min_size() -> usize
[src]
pub fn min_size() -> usize
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns the minimum encoded size of a value of type T
.
Trait Implementations
impl<'a, 'tcx, T> SpecializedEncoder<Lazy<T>> for EncodeContext<'a, 'tcx>
[src]
impl<'a, 'tcx, T> SpecializedEncoder<Lazy<T>> for EncodeContext<'a, 'tcx>
fn specialized_encode(&mut self, lazy: &Lazy<T>) -> Result<(), Self::Error>
[src]
fn specialized_encode(&mut self, lazy: &Lazy<T>) -> Result<(), Self::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Encode the value in a manner specific to this encoder state.
impl<'a, 'tcx, T> SpecializedDecoder<Lazy<T>> for DecodeContext<'a, 'tcx>
[src]
impl<'a, 'tcx, T> SpecializedDecoder<Lazy<T>> for DecodeContext<'a, 'tcx>
fn specialized_decode(&mut self) -> Result<Lazy<T>, Self::Error>
[src]
fn specialized_decode(&mut self) -> Result<Lazy<T>, Self::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Decode a value in a manner specific to this decoder state.
impl<T> Copy for Lazy<T>
[src]
impl<T> Copy for Lazy<T>
impl<T> Clone for Lazy<T>
[src]
impl<T> Clone for Lazy<T>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> UseSpecializedEncodable for Lazy<T>
[src]
impl<T> UseSpecializedEncodable for Lazy<T>
fn default_encode<E>(&self, &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
[src]
fn default_encode<E>(&self, &mut E) -> Result<(), <E as Encoder>::Error> where
E: Encoder,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Defaults to returning an error (see SpecializationError
).
impl<T> UseSpecializedDecodable for Lazy<T>
[src]
impl<T> UseSpecializedDecodable for Lazy<T>
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
[src]
fn default_decode<D>(&mut D) -> Result<Self, <D as Decoder>::Error> where
D: Decoder,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Defaults to returning an error (see SpecializationError
).
impl<CTX, T> HashStable<CTX> for Lazy<T>
[src]
impl<CTX, T> HashStable<CTX> for Lazy<T>
fn hash_stable<W: StableHasherResult>(
&self,
_: &mut CTX,
_: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
_: &mut CTX,
_: &mut StableHasher<W>
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?