Struct FileOwners

Source
pub struct FileOwners<Tree: Ast>(/* private fields */);

Implementations§

Source§

impl<Tree: Ast> FileOwners<Tree>

Source

pub fn new() -> Self

Source

pub fn push(&self, file: FileOwner<Tree>)

Methods from Deref<Target = FrozenVec<Box<FileOwner<Tree>>>>§

Source

pub fn push(&self, val: T)

Appends an element to the back of the vector.

Source

pub fn push_get(&self, val: T) -> &<T as Deref>::Target

Push, immediately getting a reference to the element

Source

pub fn get(&self, index: usize) -> Option<&<T as Deref>::Target>

Returns a reference to an element.

Source

pub unsafe fn get_unchecked(&self, index: usize) -> &<T as Deref>::Target

Returns a reference to an element, without doing bounds checking.

§Safety

index must be in bounds, i.e. it must be less than self.len()

Source

pub fn get_copy(&self, index: usize) -> Option<T>

Returns a copy of an element.

Source

pub fn len(&self) -> usize

Returns the number of elements in the vector.

Source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

Source

pub fn first(&self) -> Option<&<T as Deref>::Target>

Returns the first element of the vector, or None if empty.

Source

pub fn last(&self) -> Option<&<T as Deref>::Target>

Returns the last element of the vector, or None if empty.

Source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the vector.

Binary searches this sorted vector for a given element, analogous to slice::binary_search.

Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a <T as Deref>::Target) -> Ordering,

Binary searches this sorted vector with a comparator function, analogous to slice::binary_search_by.

Source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, ) -> Result<usize, usize>
where F: FnMut(&'a <T as Deref>::Target) -> B, B: Ord,

Binary searches this sorted vector with a key extraction function, analogous to slice::binary_search_by_key.

Source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&<T as Deref>::Target) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition), analogous to slice::partition_point.

Trait Implementations§

Source§

impl<Tree: Ast> Debug for FileOwners<Tree>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Tree: Ast> Default for FileOwners<Tree>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Tree: Ast> Deref for FileOwners<Tree>

Source§

type Target = FrozenVec<Box<FileOwner<Tree>>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<Tree> !Freeze for FileOwners<Tree>

§

impl<Tree> !RefUnwindSafe for FileOwners<Tree>

§

impl<Tree> Send for FileOwners<Tree>
where Tree: Send,

§

impl<Tree> !Sync for FileOwners<Tree>

§

impl<Tree> Unpin for FileOwners<Tree>

§

impl<Tree> UnwindSafe for FileOwners<Tree>
where Tree: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V