Function ccntool_core::queryall
source · pub fn queryall(conn: Pool<MySql>) -> Result<Vec<String>, Error>
Expand description
This function will query all available, valid wallsocket descriptions.
Arguments
conn
- APool<MySql>
representing a connection to thedcim
database.
Returns
Returns a Result
containing a Vec<String>
if the connection was
successful, or an sqlx::Error
if an error occurred.
Errors
Returns an error of type sqlx::Error
if no matching row is found in
the fac_Ports
table.
Example
fn main() {
let ports: Vec<String> = vec![];
let all_ports = queryall(connectdb(None, None, None)
.expect("Can't connect to database!"))
.unwrap();
println!("All ports: {:?}", all_ports);
}