Struct rustc_metadata::schema::LazySeq [−][src]
#[must_use]pub struct LazySeq<T> { pub len: usize, 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 sequence of type T referred to by its absolute position
in the metadata and length, and which can be decoded lazily.
The sequence is a single node for the purposes of Lazy
.
Unlike Lazy<Vec<T>>
, the length is encoded next to the
position, not at the position, which means that the length
doesn't need to be known before encoding all the elements.
If the length is 0, no position is encoded, but otherwise,
the encoding is that of Lazy
, with the distinction that
the minimal distance the length of the sequence, i.e.
it's assumed there's no 0-byte element in the sequence.
Fields
len: 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?
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<'tcx> LazySeq<Index>
[src]
impl<'tcx> LazySeq<Index>
pub fn lookup(
&self,
bytes: &[u8],
def_index: DefIndex
) -> Option<Lazy<Entry<'tcx>>>
[src]
pub fn lookup(
&self,
bytes: &[u8],
def_index: DefIndex
) -> Option<Lazy<Entry<'tcx>>>
🔬 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?
Given the metadata, extract out the offset of a particular DefIndex (if any).
impl<'a, 'tcx: 'a, T: Decodable> LazySeq<T>
[src]
impl<'a, 'tcx: 'a, T: Decodable> LazySeq<T>
pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> <'tcx, 'a>
[src]
pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> <'tcx, 'a>
🔬 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> LazySeq<T>
[src]
impl<T> LazySeq<T>
pub fn empty() -> LazySeq<T>
[src]
pub fn empty() -> LazySeq<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 with_position_and_length(position: usize, len: usize) -> LazySeq<T>
[src]
pub fn with_position_and_length(position: usize, len: usize) -> LazySeq<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(length: usize) -> usize
[src]
pub fn min_size(length: usize) -> 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 length
values of type T
.
Trait Implementations
impl<'a, 'tcx, T> SpecializedEncoder<LazySeq<T>> for EncodeContext<'a, 'tcx>
[src]
impl<'a, 'tcx, T> SpecializedEncoder<LazySeq<T>> for EncodeContext<'a, 'tcx>
fn specialized_encode(&mut self, seq: &LazySeq<T>) -> Result<(), Self::Error>
[src]
fn specialized_encode(&mut self, seq: &LazySeq<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<LazySeq<T>> for DecodeContext<'a, 'tcx>
[src]
impl<'a, 'tcx, T> SpecializedDecoder<LazySeq<T>> for DecodeContext<'a, 'tcx>
fn specialized_decode(&mut self) -> Result<LazySeq<T>, Self::Error>
[src]
fn specialized_decode(&mut self) -> Result<LazySeq<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 LazySeq<T>
[src]
impl<T> Copy for LazySeq<T>
impl<T> Clone for LazySeq<T>
[src]
impl<T> Clone for LazySeq<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 LazySeq<T>
[src]
impl<T> UseSpecializedEncodable for LazySeq<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 LazySeq<T>
[src]
impl<T> UseSpecializedDecodable for LazySeq<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 LazySeq<T>
[src]
impl<CTX, T> HashStable<CTX> for LazySeq<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?