pub struct Table { /* private fields */ }Expand description
テーブル構造を定義します。
Implementations§
Source§impl Table
impl Table
Sourcepub fn insert_value<T: Display>(&mut self, key: &str, value: T)
pub fn insert_value<T: Display>(&mut self, key: &str, value: T)
指定したキーに値を挿入します。
Sourcepub fn insert_table(&mut self, key: &str, table: Table)
pub fn insert_table(&mut self, key: &str, table: Table)
指定したキーにサブテーブルを挿入します。
Sourcepub fn remove_value(&mut self, key: &str)
pub fn remove_value(&mut self, key: &str)
指定したキーの値を削除します。
Sourcepub fn remove_table(&mut self, key: &str)
pub fn remove_table(&mut self, key: &str)
指定したキーのサブテーブルを削除します。
Sourcepub fn parse_value<T: FromTableValue>(
&self,
key: &str,
) -> Option<Result<T, T::Err>>
pub fn parse_value<T: FromTableValue>( &self, key: &str, ) -> Option<Result<T, T::Err>>
指定したキーの値をパースして読み取ります。
Sourcepub fn get_value_mut(&mut self, key: &str) -> Option<&mut String>
pub fn get_value_mut(&mut self, key: &str) -> Option<&mut String>
指定したキーの値への可変参照を取得します。
Sourcepub fn get_table_mut(&mut self, key: &str) -> Option<&mut Table>
pub fn get_table_mut(&mut self, key: &str) -> Option<&mut Table>
指定したキーのサブテーブルへの可変参照を取得します。
Sourcepub fn values<'a>(&'a self) -> TableValuesIterator<'a> ⓘ
pub fn values<'a>(&'a self) -> TableValuesIterator<'a> ⓘ
値を列挙するイテレーターを返します。
Sourcepub fn values_mut<'a>(&'a mut self) -> TableValuesIteratorMut<'a> ⓘ
pub fn values_mut<'a>(&'a mut self) -> TableValuesIteratorMut<'a> ⓘ
可変参照で値を列挙します。
Sourcepub fn is_values_empty(&self) -> bool
pub fn is_values_empty(&self) -> bool
値が空かどうかを返します。
Sourcepub fn subtables<'a>(&'a self) -> SubTablesIterator<'a> ⓘ
pub fn subtables<'a>(&'a self) -> SubTablesIterator<'a> ⓘ
子テーブルを列挙するイテレーターを返します。
Sourcepub fn subtables_mut<'a>(&'a mut self) -> SubTablesIteratorMut<'a> ⓘ
pub fn subtables_mut<'a>(&'a mut self) -> SubTablesIteratorMut<'a> ⓘ
子テーブルを可変参照で列挙します。
Sourcepub fn is_subtables_empty(&self) -> bool
pub fn is_subtables_empty(&self) -> bool
子テーブルが空かどうかを返します。
Sourcepub fn iter_subtables_as_array<'a>(&'a self) -> ArraySubTablesIterator<'a> ⓘ
pub fn iter_subtables_as_array<'a>(&'a self) -> ArraySubTablesIterator<'a> ⓘ
0、1、2…のキーを持つ子テーブルを配列として列挙するイテレーターを返します。
Trait Implementations§
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.