pub trait SqlConnection> { fn new(uri: &str) -> Result<~Self, ~str>; fn prepare<'a>(&'a self, query: &str) -> Result<~S, ~str>; } pub trait SqlStatement> { fn query(&self, params: &[~str], blk: &fn(&R) -> Result) -> Result; fn update(&self, params: &[~str]) -> Result; } pub trait SqlResult>: Container { fn iter(&self) -> I; } pub trait SqlRow: Container { fn get>(&self, index: uint) -> Option; } pub trait FromSql { fn from_sql(row: &R, column: uint) -> Option; }