pub struct App {
pub path: Option<String>,
pub data: Vec<AppData>,
pub keys: Vec<String>,
/* private fields */
}
Expand description
Fields§
§path: Option<String>
文件路径
data: Vec<AppData>
储存数据
keys: Vec<String>
键名列表
Implementations§
Source§impl App
impl App
pub fn merge_data(&mut self, data: Vec<AppData>)
Sourcepub fn create_data(&self) -> AppData
pub fn create_data(&self) -> AppData
创建空的数据
Trait Implementations§
Source§impl Editor for App
impl Editor for App
Source§fn replace(&mut self, index: usize, new_data: AppData)
fn replace(&mut self, index: usize, new_data: AppData)
修改一行数据 #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());
Source§fn remove(&mut self, index: usize)
fn remove(&mut self, index: usize)
删除某一列数据 #Example
use file_sql::*;
let app = App::from_file("example.fql");
app.remove(1); // 删除第二行数据
fn update<T: Display>(&mut self, index: usize, key: T, new_value: FQLType)
Source§impl Reader for App
impl Reader for App
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnwindSafe for App
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