[][src]Struct vcd::Header

#[non_exhaustive]pub struct Header {
    pub comment: Option<String>,
    pub date: Option<String>,
    pub version: Option<String>,
    pub timescale: Option<(u32, TimescaleUnit)>,
    pub items: Vec<ScopeItem>,
}

Structure containing the data from the header of a VCD file.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
comment: Option<String>date: Option<String>version: Option<String>timescale: Option<(u32, TimescaleUnit)>items: Vec<ScopeItem>

Implementations

impl Header[src]

pub fn find_scope<S>(&self, path: &[S]) -> Option<&Scope> where
    S: Borrow<str>, 
[src]

Find the scope object at a specified path.

Example

let mut parser = vcd::Parser::new(&b"
$scope module a $end
$scope module b $end
$var integer 16 n0 counter $end
$upscope $end
$upscope $end
$enddefinitions $end
"[..]);
let header = parser.parse_header().unwrap();
let scope = header.find_scope(&["a", "b"]).unwrap();
assert_eq!(scope.identifier, "b");

pub fn find_var<S>(&self, path: &[S]) -> Option<&Var> where
    S: Borrow<str>, 
[src]

Find the variable object at a specified path.

Example

let mut parser = vcd::Parser::new(&b"
$scope module a $end
$scope module b $end
$var integer 16 n0 counter $end
$upscope $end
$upscope $end
$enddefinitions $end
"[..]);
let header = parser.parse_header().unwrap();
let var = header.find_var(&["a", "b", "counter"]).unwrap();
assert_eq!(var.reference, "counter");

Trait Implementations

impl Debug for Header[src]

impl Default for Header[src]

Auto Trait Implementations

impl RefUnwindSafe for Header

impl Send for Header

impl Sync for Header

impl Unpin for Header

impl UnwindSafe for Header

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.