pub struct Database {
pub name: String,
pub desc: String,
}
Fields§
§name: String
§desc: String
Implementations§
Source§impl Database
impl Database
Sourcepub fn all() -> Self
pub fn all() -> Self
Examples found in repository?
examples/read_definitions.rs (line 14)
7fn main() {
8 let addr = std::env::args().next_back().unwrap();
9 let stream = TcpStream::connect(addr).expect("Invalid socket address");
10
11 let mut conn = DICTConnection::new(stream).unwrap();
12 conn.next();
13
14 let (defs, _) = conn.define(Database::all(), String::from("ti")).expect("Damn");
15
16 for def in defs {
17 println!("{}", def.source.desc);
18 }
19}
More examples
examples/read_matches.rs (line 14)
7fn main() {
8 let addr = std::env::args().next_back().unwrap();
9 let stream = TcpStream::connect(addr).expect("Invalid socket address");
10
11 let mut conn = DICTConnection::new(stream).unwrap();
12 conn.next();
13
14 let (matches, _) = conn.match_db(Database::all(), Strategy::default(), String::from("ti")).expect("Damn");
15
16 for m in matches {
17 println!("{} : {}", m.source.desc, m.word);
18 }
19}
pub fn first() -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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