[][src]Struct cpclib_basic::BasicLine

pub struct BasicLine { /* fields omitted */ }

Basic line of code representation

Methods

impl BasicLine[src]

pub fn line_number(&self) -> u16[src]

pub fn new(line_number: u16, tokens: &[BasicToken]) -> Self[src]

Create a line with its content

pub fn add_length(&mut self, length: u16)[src]

pub fn set_length(&mut self, length: u16)[src]

pub fn forced_length(&self) -> u16[src]

Return the forced line length or the real line length if not specified

pub fn real_length(&self) -> u16[src]

Return the byte size taken by the tokens

pub fn len(&self) -> usize[src]

Returns the number of tokens

pub fn is_empty(&self) -> bool[src]

Verify if there are tokens

pub fn as_bytes(&self) -> Vec<u8>[src]

Returns the encoded line.

  • 2 bytes for data length -- Could be different than reallity when playing with hidden lines
  • 2 bytes for line number
  • n bytes for tokens
  • 1 bytes for end of line marker

pub fn tokens(&self) -> &[BasicToken][src]

Trait Implementations

impl Clone for BasicLine[src]

impl Debug for BasicLine[src]

impl Display for BasicLine[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.