Struct ide_db::EditionedFileId
pub struct EditionedFileId(/* private fields */);
Expand description
A FileId
and [Edition
] bundled up together.
The MSB is reserved for HirFileId
encoding, more upper bits are used to then encode the edition.
Implementations§
§impl EditionedFileId
impl EditionedFileId
pub const RESERVED_MASK: u32 = 2_147_483_648u32
pub const EDITION_MASK: u32 = 2_139_095_040u32
pub const FILE_ID_MASK: u32 = 8_388_607u32
pub const MAX_FILE_ID: u32 = 8_388_607u32
pub const RESERVED_HIGH_BITS: u32 = 1u32
pub const FILE_ID_BITS: u32 = 23u32
pub const EDITION_BITS: u32 = 8u32
pub const fn current_edition(file_id: FileId) -> EditionedFileId
pub const fn new(file_id: FileId, edition: Edition) -> EditionedFileId
pub fn from_raw(u32: u32) -> EditionedFileId
pub const fn as_u32(self) -> u32
pub const fn file_id(self) -> FileId
pub const fn unpack(self) -> (FileId, Edition)
pub const fn edition(self) -> Edition
Trait Implementations§
§impl Clone for EditionedFileId
impl Clone for EditionedFileId
§fn clone(&self) -> EditionedFileId
fn clone(&self) -> EditionedFileId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for EditionedFileId
impl Debug for EditionedFileId
§impl From<EditionedFileId> for FileId
impl From<EditionedFileId> for FileId
§fn from(value: EditionedFileId) -> FileId
fn from(value: EditionedFileId) -> FileId
Converts to this type from the input type.
§impl Hash for EditionedFileId
impl Hash for EditionedFileId
§impl Ord for EditionedFileId
impl Ord for EditionedFileId
§impl PartialEq<EditionedFileId> for FileId
impl PartialEq<EditionedFileId> for FileId
§impl PartialEq<FileId> for EditionedFileId
impl PartialEq<FileId> for EditionedFileId
§impl PartialEq<HirFileId> for EditionedFileId
impl PartialEq<HirFileId> for EditionedFileId
§impl PartialEq for EditionedFileId
impl PartialEq for EditionedFileId
§impl PartialOrd for EditionedFileId
impl PartialOrd for EditionedFileId
impl Copy for EditionedFileId
impl Eq for EditionedFileId
impl StructuralPartialEq for EditionedFileId
Auto Trait Implementations§
impl Freeze for EditionedFileId
impl RefUnwindSafe for EditionedFileId
impl Send for EditionedFileId
impl Sync for EditionedFileId
impl Unpin for EditionedFileId
impl UnwindSafe for EditionedFileId
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
§impl<T> Cast for T
impl<T> Cast for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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