pub enum Sequence<T>where
T: DafnyType,{
ArraySequence {
values: Rc<Vec<T>>,
},
ConcatSequence {
left: Rc<UnsafeCell<Sequence<T>>>,
right: Rc<UnsafeCell<Sequence<T>>>,
length: SizeT,
boxed: Rc<RefCell<Option<Rc<Vec<T>>>>>,
},
}Variants§
Implementations§
Source§impl<T> Sequence<T>where
T: DafnyType,
impl<T> Sequence<T>where
T: DafnyType,
pub fn from_array(values: Ptr<[T]>) -> Sequence<T>
pub fn from_array_object(values: &Object<[T]>) -> Sequence<T>
pub fn from_array_slice( values: Ptr<[T]>, start: &DafnyInt, end: &DafnyInt, ) -> Sequence<T>
pub fn from_array_slice_object( values: &Object<[T]>, start: &DafnyInt, end: &DafnyInt, ) -> Sequence<T>
pub fn from_array_take(values: Ptr<[T]>, n: &DafnyInt) -> Sequence<T>
pub fn from_array_take_object(values: &Object<[T]>, n: &DafnyInt) -> Sequence<T>
pub fn from_array_drop(values: Ptr<[T]>, n: &DafnyInt) -> Sequence<T>
pub fn from_array_drop_object(values: &Object<[T]>, n: &DafnyInt) -> Sequence<T>
pub fn from_array_owned(values: Vec<T>) -> Sequence<T>
pub fn new_concat_sequence( left: &Sequence<T>, right: &Sequence<T>, ) -> Sequence<T>
pub fn to_array(&self) -> Rc<Vec<T>>
pub fn append_recursive(array: &mut Vec<T>, this: &Sequence<T>)
Sourcepub fn cardinality_usize(&self) -> SizeT
pub fn cardinality_usize(&self) -> SizeT
Returns the cardinality of this Sequence<T>.
pub fn cardinality(&self) -> DafnyInt
pub fn get_usize(&self, index: SizeT) -> T
pub fn slice(&self, start: &DafnyInt, end: &DafnyInt) -> Sequence<T>
pub fn take(&self, end: &DafnyInt) -> Sequence<T>
pub fn drop(&self, start: &DafnyInt) -> Sequence<T>
pub fn update_index(&self, index: &DafnyInt, value: &T) -> Self
pub fn concat(&self, other: &Sequence<T>) -> Sequence<T>
pub fn get(&self, index: &DafnyInt) -> T
pub fn iter(&self) -> SequenceIter<T> ⓘ
Source§impl<T: DafnyTypeEq> Sequence<T>
impl<T: DafnyTypeEq> Sequence<T>
pub fn as_dafny_multiset(&self) -> Multiset<T>
Trait Implementations§
Source§impl<V: DafnyType> DafnyPrint for Sequence<V>
impl<V: DafnyType> DafnyPrint for Sequence<V>
Source§impl<T: DafnyType> FromIterator<T> for Sequence<T>
impl<T: DafnyType> FromIterator<T> for Sequence<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T: DafnyType> NontrivialDefault for Sequence<T>
impl<T: DafnyType> NontrivialDefault for Sequence<T>
fn nontrivial_default() -> Self
Source§impl<T: DafnyTypeEq> PartialOrd for Sequence<T>
impl<T: DafnyTypeEq> PartialOrd for Sequence<T>
impl<T: DafnyTypeEq> Eq for Sequence<T>
Auto Trait Implementations§
impl<T> Freeze for Sequence<T>
impl<T> !RefUnwindSafe for Sequence<T>
impl<T> !Send for Sequence<T>
impl<T> !Sync for Sequence<T>
impl<T> Unpin for Sequence<T>
impl<T> !UnwindSafe for Sequence<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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