[][src]Struct naromat::entities::line::Line

pub struct Line { /* fields omitted */ }

Structure of novel line

Lines are defined below:

  • Starts after breakline or chapter head
  • End with breakline

Methods

impl Line[src]

Implementation of novel line structure

pub fn new(text: &str) -> Self[src]

Constructor

Example

use naromat::entities::line::Line;
 
Line::new("我が輩は猫である。名前はまだない。");

pub fn print(self)[src]

Print formatted line

Example

use naromat::entities::line::Line;
 
let line = Line::new("我が輩は猫である。名前はまだない。");
line.print()

pub fn get(self) -> String[src]

Get string of formatted sentence

Example

use naromat::entities::line::Line;
let line = Line::new("我が[輩:.]は[猫:ねこ]である。どこで生まれたかとんと見当がつかぬ。");
assert_eq!(line.get(), " 我が|輩《・》は|猫《ねこ》である。どこで生まれたかとんと見当がつかぬ。");

Auto Trait Implementations

impl RefUnwindSafe for Line

impl Send for Line

impl Sync for Line

impl Unpin for Line

impl UnwindSafe for Line

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.