[−][src]Enum dwfv::signaldb::SignalValue
Value of a signal
Variants
Concrete value of the signal
Symbol(String)
Symbolic value of the signal
Implementations
impl SignalValue
[src]
pub fn new(value: u64) -> SignalValue
[src]
Create a new SignalValue
from an integer.
Example:
use dwfv::signaldb::SignalValue; let mut value = SignalValue::new(0x42);
pub fn new_default(width: usize, value: BitValue) -> SignalValue
[src]
Create a new SignalValue
with the same BitValue
for every bit.
Example:
use dwfv::signaldb::{BitValue, SignalValue}; let mut value = SignalValue::new_default(16, BitValue::High); assert_eq!(value, SignalValue::new(0xFFFF));
pub fn from_symbol_str(s: &str) -> SignalValue
[src]
Create a SignalValue
from a symbol.
Example
use dwfv::signaldb::SignalValue; let v = SignalValue::from_symbol_str("foo"); assert_eq!(v, SignalValue::Symbol("foo".to_string()));
pub fn from_hex(s: &str) -> SignalValue
[src]
Create a SignalValue
from an hex string.
Example
use dwfv::signaldb::SignalValue; let v = SignalValue::from_hex("2A"); assert_eq!(v, SignalValue::new(42));
pub fn invalid() -> SignalValue
[src]
Create an invalid SignalValue
.
Example
use dwfv::signaldb::SignalValue; let v = SignalValue::invalid(); assert_eq!(v.is_invalid(), true);
pub fn expand(&mut self, width: usize)
[src]
Expand the width of a SignalValue
.
Example
use dwfv::signaldb::{BitValue, SignalValue}; let mut v = SignalValue::new_default(16, BitValue::High); assert_eq!(v.width(), 16); v.expand(32); assert_eq!(v.width(), 32); assert_eq!(v, SignalValue::new(0xFFFF));
pub fn width(&self) -> usize
[src]
Get the width of a SignalValue
.
Example
use dwfv::signaldb::SignalValue; let v = SignalValue::new(42); assert_eq!(v.width(), 6);
pub fn is_invalid(&self) -> bool
[src]
Trait Implementations
impl Clone for SignalValue
[src]
fn clone(&self) -> SignalValue
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SignalValue
[src]
impl Display for SignalValue
[src]
impl Eq for SignalValue
[src]
impl FromStr for SignalValue
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<SignalValue> for SignalValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for SignalValue
impl Send for SignalValue
impl Sync for SignalValue
impl Unpin for SignalValue
impl UnwindSafe for SignalValue
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<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>,