Skip to main content

AstVector

Struct AstVector 

Source
pub struct AstVector { /* private fields */ }
Expand description

Vector of Z3 AST nodes.

This wraps a Z3-ref-counted vector of asts. This type exists mainly as a high-level compatibility layer for these types from Rust. As this type wraps heterogenous asts, it is analagous to Vec<Dynamic>.

Most users will usually be better off using a Vec; this type primarily exists as a compatibility shim.

Many standard rust collection and iteration traits are implemented on it for convenience.

Implementations§

Source§

impl AstVector

Source

pub fn new() -> AstVector

Create a new empty AST vector.

Source

pub fn len(&self) -> usize

Get the number of elements in the vector.

Source

pub fn is_empty(&self) -> bool

Check if the vector is empty.

Source

pub fn get(&self, index: usize) -> Dynamic

Get the element at the specified index.

§Panics

Panics if the index is out of bounds.

Source

pub fn set(&self, index: usize, ast: &impl Ast)

Set the element at the specified index.

§Panics

Panics if the index is out of bounds.

Source

pub fn push(&self, ast: &impl Ast)

Push an element to the end of the vector.

Source

pub fn resize(&self, new_size: usize)

Resize the vector to the specified size.

New elements (if any) are uninitialized.

Source

pub fn to_vec(&self) -> Vec<Dynamic>

Convert the vector to a Vec<Dynamic>.

Source

pub fn translate(&self, target_ctx: &Context) -> AstVector

Translate the AST vector to another context.

Source

pub fn iter(&self) -> AstVectorIter<'_>

Return a borrowing iterator over the elements.

Trait Implementations§

Source§

impl Debug for AstVector

Source§

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

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

impl Default for AstVector

Source§

fn default() -> Self

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

impl Display for AstVector

Source§

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

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

impl Drop for AstVector

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T: Ast> From<&[T]> for AstVector

Build an AstVector from a borrowed slice, avoiding clones.

Source§

fn from(slice: &[T]) -> Self

Converts to this type from the input type.
Source§

impl<T: Ast> From<Vec<T>> for AstVector

Source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Ast> FromIterator<T> for AstVector

Source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> IntoIterator for &'a AstVector

Source§

type Item = Dynamic

The type of the elements being iterated over.
Source§

type IntoIter = AstVectorIter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl IntoIterator for AstVector

Source§

type Item = Dynamic

The type of the elements being iterated over.
Source§

type IntoIter = AstVectorIntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl TryFrom<AstVector> for Vec<Array>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<BV>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Bool>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Datatype>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Float>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Int>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Real>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Seq>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<Set>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<AstVector> for Vec<String>

Source§

type Error = String

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

fn try_from(v: AstVector) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

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, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

Source§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.