pub struct Table {
pub origin: Origin,
/* private fields */
}
Expand description
一文字から一文字の置換テーブルを定義する構造体です。
Fields
origin: Origin
一文字から一文字の置換テーブルを定義している場所を指定します。
Implementations
sourceimpl Table
impl Table
sourcepub fn builder(self) -> TableBuilder
pub fn builder(self) -> TableBuilder
TableBuilder を初期化して返します。
use chanoma::Table;
let table = Table::new().builder();
sourcepub fn from_corr(corr: Correspondence<Synthesized>, origin: Origin) -> Self
pub fn from_corr(corr: Correspondence<Synthesized>, origin: Origin) -> Self
置換テーブルに Correspondence を登録します。
use chanoma::{Correspondence, Synthesized, Table, table::Origin};
let corr: Correspondence<Synthesized> = Correspondence::default();
let table = Table::from_corr(corr, Origin::New);
sourcepub fn add<T: Corr>(&mut self, corr: &Correspondence<T>)
pub fn add<T: Corr>(&mut self, corr: &Correspondence<T>)
置換テーブルに Correspondence を追加します。
use chanoma::{Correspondence, Synthesized, Table};
let mut table = Table::new();
let corr: Correspondence<Synthesized> = Correspondence::default();
table.add(&corr);
sourcepub fn remove<T: Corr>(&mut self, corr: &Correspondence<T>)
pub fn remove<T: Corr>(&mut self, corr: &Correspondence<T>)
置換テーブルに登録されている Correspondence を削除します。
use chanoma::{Correspondence, Synthesized, Table};
let mut table = Table::new();
let corr: Correspondence<Synthesized> = Correspondence::default();
table.remove(&corr);
sourcepub fn corr(&self) -> Correspondence<Synthesized>
pub fn corr(&self) -> Correspondence<Synthesized>
置換テーブルに登録されている Correspondence を返します。
use chanoma::{Correspondence, Synthesized, Table};
let table = Table::new();
println!("{:?}", table.corr());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more