pub fn labels(&self) -> IndexSet<&Label<'a>> {
        self.lines()
            .into_iter()
            .flat_map(|ref line| match line {
                Line::LabelLine(l) => Some(l),
                _ => None,
            })
            .collect()
    }
/// Get the set of all labels *declared* in the program.
///
/// This does not include labels that are used as arguments to jumping
/// instructions such as `jz`.
///
/// ## Example
/// ```rust
/// # #![feature(try_from)]
/// # #[macro_use]
/// # extern crate indexmap;
/// # use std::convert::TryFrom;
/// # use attasm::ast::*;
/// # pub fn main() {
/// let program = Program::try_from(
///     "
///     label1:
///         inc %rax
///         jz  %rax, label2
///     "
/// ).unwrap();
///
/// let label = Label::new("label1");
/// assert_eq!(program.labels(), indexset!{&label});
/// # }
/// ```
Get the set of all labels *declared* in the program.
This does not include labels that are used as arguments to jumping
instructions such as `jz`.
Get the set of all labels * declared * in the program . This does not include labels that are used as arguments to jumping instructions such as ` jz ` .
pub fn labels(&self) -> IndexSet<&Label<'a>> {
        self.lines()
            .into_iter()
            .flat_map(|ref line| match line {
                Line::LabelLine(l) => Some(l),
                _ => None,
            })
            .collect()
    }
pub fn labels ( & self ) -> IndexSet < & Label < ' a > > { self . lines ( ) . into_iter ( ) . flat_map ( | ref line | match line { Line :: LabelLine ( l ) => Some ( l ) , _ => None , } ) . collect ( ) }
Get the set of all labels *declared* in the program.
Get the set of all labels * declared * in the program .
&self
example
None
#![feature(try_from)]
None
#[macro_use]
None
extern crate indexmap;
None
use std::convert::tryfrom;
None
use attasm::ast::*;
None
pub fn main() {
let program = Program::try_from(
"
label1:
inc %rax
jz  %rax, label2
"
).unwrap().

let label = Label::new("label1");
assert_eq!(program.labels(), indexset!{&label}).
let program = Program :: try_from ( " label1 : inc %rax jz %rax label2 " ) . unwrap () . let label = Label :: new ( " label1 " ) ; assert_eq! ( program . labels () indexset! { &label } ) .
}
None