[−][src]Struct file_sql::app::App
Fields
path: Option<String>
文件路径
data: Vec<AppData>
储存数据
keys: Vec<String>
键名列表
Implementations
impl App
[src]
pub fn from_file<T: Display>(path: T) -> Result<Self>
[src]
加载 fql 文件
pub fn serialize(&self) -> Vec<HashMap<String, Value>>
[src]
直接生成可序列化数据
pub fn merge_data(&mut self, data: Vec<AppData>)
[src]
pub fn save_at<T: Display>(&self, path: T)
[src]
保存文件到指定位置
pub fn create_data(&self) -> AppData
[src]
创建空的数据
pub fn init_data(&self, data: &mut AppData)
[src]
将指定数据初始化
pub fn save(&self)
[src]
保存文件
Trait Implementations
impl Clone for App
[src]
impl Debug for App
[src]
impl Editor for App
[src]
pub fn replace(&mut self, index: usize, new_data: AppData)
[src]
修改一行数据 #Example
use file_sql::*; let app = App::from_file("example.fql"); let new_data = app.find_index(1); app.replace(0, "age", new_data.to_owned());
pub fn insert(&mut self, index: usize, new_data: AppData)
[src]
在指定一行加入数据
pub fn remove(&mut self, index: usize)
[src]
删除某一列数据 #Example
use file_sql::*; let app = App::from_file("example.fql"); app.remove(1); // 删除第二行数据
pub fn update<T: Display>(&mut self, index: usize, key: T, new_value: FQLType)
[src]
pub fn add(&mut self, new_data: AppData)
[src]
添加数据到末尾
impl From<&'_ str> for App
[src]
impl From<Vec<&'_ AppData, Global>> for App
[src]
impl From<Vec<AppData, Global>> for App
[src]
impl From<Vec<String, Global>> for App
[src]
impl Into<Vec<Vec<FQLType, Global>, Global>> for App
[src]
impl Reader for App
[src]
pub fn index(&self, index: usize) -> Option<&AppData>
[src]
查找指定序号的数据
pub fn find<T: Display>(&self, key: T, val: FQLType) -> Option<&AppData>
[src]
查找第一个符合条件的数据
pub fn find_index<T: Display>(&self, key: T, val: FQLType) -> Option<usize>
[src]
查找第一个符合条件的数据的序号
pub fn find_all<T: Display>(&self, key: T, val: FQLType) -> Vec<&AppData>
[src]
获取所有符合条件的数据
pub fn find_all_index<T: Display>(&self, key: T, val: FQLType) -> Vec<usize>
[src]
获取所有符合条件的数据序号
pub fn find_by<T: Display>(
&self,
key: T,
f: impl Fn(&FQLType) -> bool
) -> Vec<&AppData>
[src]
&self,
key: T,
f: impl Fn(&FQLType) -> bool
) -> Vec<&AppData>
获取所有符合过滤函数的数据
pub fn find_index_by<T: Display>(
&self,
key: T,
f: impl Fn(&FQLType) -> bool
) -> Vec<usize>
[src]
&self,
key: T,
f: impl Fn(&FQLType) -> bool
) -> Vec<usize>
pub fn find_index_from_data(&self, data: &AppData) -> Option<usize>
[src]
Auto Trait Implementations
impl RefUnwindSafe for App
[src]
impl Send for App
[src]
impl Sync for App
[src]
impl Unpin for App
[src]
impl UnwindSafe for App
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,