Struct malwaredb_server::db::sqlite::Sqlite
source · pub struct Sqlite { /* private fields */ }
Expand description
Handle to an SQLite file
Implementations§
source§impl Sqlite
impl Sqlite
pub fn new(file_name: &str) -> Result<Self>
pub fn first_run(&self) -> bool
pub fn enable_compression(&self) -> Result<()>
pub fn enable_vt_upload(&self) -> Result<()>
pub fn files_without_vt_records(&self, limit: i32) -> Result<Vec<String>>
pub fn store_vt_record(&self, results: &ScanResultAttributes) -> Result<()>
pub fn get_vt_stats(&self) -> Result<VtStats>
pub fn get_config(&self) -> Result<MDBConfig>
pub fn authenticate(&self, uname: &str, password: &str) -> Result<String>
pub fn get_uid(&self, apikey: &str) -> Result<i32>
pub fn db_info(&self) -> Result<DatabaseInformation>
pub fn get_user_info(&self, uid: i32) -> Result<GetUserInfoResponse>
pub fn reset_own_api_key(&self, uid: i32) -> Result<()>
pub fn get_known_data_types(&self) -> Result<Vec<FileType>>
pub fn get_labels(&self) -> Result<Labels>
pub fn get_type_id_for_bytes(&self, data: &[u8]) -> Result<i32>
pub fn allowed_user_source(&self, uid: i32, sid: i32) -> Result<bool>
pub fn user_is_admin(&self, uid: i32) -> Result<bool>
pub fn add_file( &self, meta: &FileMetadata, known_type: KnownType<'_>, uid: i32, sid: i32, ftype: i32, parent: Option<i64> ) -> Result<bool>
pub fn retrieve_sample(&self, uid: i32, hash: &HashType) -> Result<String>
pub fn get_sample_report(&self, uid: i32, hash: &HashType) -> Result<Report>
pub fn find_similar_samples( &self, uid: i32, sim: &[(SimilarityHashType, String)] ) -> Result<Vec<SimilarSample>>
pub fn add_file_encryption_key(&self, key: &FileEncryption) -> Result<u32>
pub fn get_encryption_key_names_ids(&self) -> Result<Vec<(u32, String)>>
pub fn create_user( &self, uname: &str, fname: &str, lname: &str, email: &str, password: Option<String>, organisation: Option<String> ) -> Result<u64>
pub fn reset_api_keys(&self) -> Result<u64>
pub fn set_password(&self, uname: &str, password: &str) -> Result<()>
pub fn list_users(&self) -> Result<Vec<User>>
pub fn group_id_from_name(&self, name: &str) -> Result<i32>
pub fn edit_group( &self, gid: i32, name: &str, desc: &str, parent: Option<i32> ) -> Result<()>
pub fn list_groups(&self) -> Result<Vec<Group>>
pub fn add_user_to_group(&self, uid: i32, gid: i32) -> Result<()>
pub fn add_group_to_source(&self, gid: i32, sid: i32) -> Result<()>
pub fn create_group( &self, name: &str, description: &str, parent: Option<i32> ) -> Result<i32>
pub fn list_sources(&self) -> Result<Vec<Source>>
pub fn create_source( &self, name: &str, description: Option<&str>, url: Option<&str>, date: DateTime<Local>, releasable: bool ) -> Result<i32>
pub fn edit_user( &self, uid: i32, uname: &str, fname: &str, lname: &str, email: &str ) -> Result<()>
pub fn deactivate_user(&self, uid: i32) -> Result<()>
pub fn file_types_counts(&self) -> Result<HashMap<String, u32>>
pub fn create_label(&self, name: &str, parent: Option<i64>) -> Result<u64>
pub fn edit_label(&self, id: u64, name: &str, parent: Option<u64>) -> Result<()>
pub fn label_id_from_name(&self, name: &str) -> Result<u64>
Trait Implementations§
impl Send for Sqlite
impl Sync for Sqlite
Auto Trait Implementations§
impl !Freeze for Sqlite
impl !RefUnwindSafe for Sqlite
impl Unpin for Sqlite
impl !UnwindSafe for Sqlite
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