[−][src]Struct tydi::physical::Complexity
Interface complexity level.
This logical stream parameter specifies the guarantees a source makes about how elements are transferred. Equivalently, it specifies the assumptions a sink can safely make.
Examples
use tydi::physical::Complexity; let c3 = Complexity::new_major(3); let c30 = Complexity::new(vec![3, 0])?; let c31 = Complexity::new(vec![3, 1])?; let c4 = Complexity::new_major(4); assert_eq!(c3, c30); assert!(c3 < c31); assert!(c31 < c4); assert_eq!(c31.to_string(), "3.1");
Methods
impl Complexity
[src]
pub fn new(level: impl IntoIterator<Item = NonNegative>) -> Result<Self>
[src]
Constructs a new Complexity with provided level. Returns an error when the provided level iterator is empty.
Examples
use tydi::physical::Complexity; let c = Complexity::new(vec![1, 2, 3, 4])?; assert!(Complexity::new(vec![]).is_err());
pub fn new_major(level: NonNegative) -> Self
[src]
Constructs a new Complexity with provided level as major version.
Examples
use tydi::physical::Complexity; let c = Complexity::new_major(4); assert_eq!(c, Complexity::new(vec![4])?);
pub fn level(&self) -> &[NonNegative]
[src]
Returns the level of this Complexity.
Examples
use tydi::physical::Complexity; let c = Complexity::new(vec![3, 14])?; assert_eq!(c.level(), &[3, 14]);
pub fn major(&self) -> NonNegative
[src]
Returns the major version of this Complexity level.
Examples
use tydi::physical::Complexity; let c = Complexity::new(vec![3, 14])?; assert_eq!(c.major(), 3);
Trait Implementations
impl Clone for Complexity
[src]
fn clone(&self) -> Complexity
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Complexity
[src]
impl Default for Complexity
[src]
impl Display for Complexity
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Display a complexity level as a version number. The levels are separated by periods.
Examples
use tydi::physical::Complexity; let c = Complexity::new(vec![3, 14])?; assert_eq!(c.to_string(), "3.14");
impl Eq for Complexity
[src]
impl From<u32> for Complexity
[src]
fn from(major: NonNegative) -> Self
[src]
Convert a NonNegative into complexity with the NonNegative as major version.
impl FromStr for Complexity
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self>
[src]
impl Ord for Complexity
[src]
fn cmp(&self, other: &Complexity) -> Ordering
[src]
A complexity number is higher than another when the leftmost integer is greater, and lower when the leftmost integer is lower. If the leftmost integer is equal, the next integer is checked recursively. If one complexity number has more entries than another, the shorter number is padded with zeros on the right.
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Complexity> for Complexity
[src]
fn eq(&self, other: &Self) -> bool
[src]
A complexity number is higher than another when the leftmost integer is greater, and lower when the leftmost integer is lower. If the leftmost integer is equal, the next integer is checked recursively. If one complexity number has more entries than another, the shorter number is padded with zeros on the right.
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Complexity> for Complexity
[src]
fn partial_cmp(&self, other: &Complexity) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl TryFrom<Vec<u32>> for Complexity
[src]
Auto Trait Implementations
impl RefUnwindSafe for Complexity
impl Send for Complexity
impl Sync for Complexity
impl Unpin for Complexity
impl UnwindSafe for Complexity
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,