Struct naromat::entities::chapter::Chapter[][src]

pub struct Chapter { /* fields omitted */ }

Structure of novel chapter.

Chapters are defined below:

  • Starts from previous chapter or start of document
  • End with next chapter or end of document

Implementations

impl Chapter[src]

Implementation for novel chapter structure

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

Constructor

Example

use naromat::entities::chapter::Chapter;
Chapter::new("
我が輩は猫である。名前はまだない。
どこで生まれたのかとんと検討がつかぬ。");

pub fn print(self)[src]

Print formatted chapter

Example

use naromat::entities::chapter::Chapter;

let chapter = Chapter::new("
我が輩は猫である。名前はまだない。
どこで[生まれた:.]のかとんと[見当:けんとう]がつかぬ。
");
chapter.print()

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

Get string of formatted sentence

Example

use naromat::entities::chapter::Chapter;
let chapter = Chapter::new("
我が輩は猫である。名前はまだない。
// コメント行
  // ネストされたコメント行
どこで[生まれた:.]のかとんと[見当:けんとう]がつかぬ。
");
assert_eq!(chapter.get(), "\n 我が輩は猫である。名前はまだない。\n どこで|生まれた《・・・・》のかとんと|見当《けんとう》がつかぬ。");

Auto Trait Implementations

impl RefUnwindSafe for Chapter

impl Send for Chapter

impl Sync for Chapter

impl Unpin for Chapter

impl UnwindSafe for Chapter

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.