Documentation fixes
This commit is contained in:
parent
f484d8dceb
commit
bba1f87721
@ -124,7 +124,7 @@ pub trait PostgresNoticeHandler {
|
|||||||
fn handle(&mut self, notice: PostgresDbError);
|
fn handle(&mut self, notice: PostgresDbError);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A struct which handles notices by logging at the info level.
|
/// A notice handler which logs at the `info` level.
|
||||||
///
|
///
|
||||||
/// This is the default handler used by a `PostgresConnection`.
|
/// This is the default handler used by a `PostgresConnection`.
|
||||||
pub struct DefaultNoticeHandler;
|
pub struct DefaultNoticeHandler;
|
||||||
@ -713,7 +713,7 @@ pub trait PostgresStatement {
|
|||||||
/// the parameters of the statement.
|
/// the parameters of the statement.
|
||||||
fn try_update(&self, params: &[&ToSql]) -> Result<uint, PostgresDbError>;
|
fn try_update(&self, params: &[&ToSql]) -> Result<uint, PostgresDbError>;
|
||||||
|
|
||||||
/// A conveience function wrapping `try_update`.
|
/// A convenience function wrapping `try_update`.
|
||||||
///
|
///
|
||||||
/// Fails if there was an error executing the statement.
|
/// Fails if there was an error executing the statement.
|
||||||
fn update(&self, params: &[&ToSql]) -> uint;
|
fn update(&self, params: &[&ToSql]) -> uint;
|
||||||
@ -1069,12 +1069,21 @@ impl<'self> Iterator<PostgresRow<'self>> for PostgresResult<'self> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A single result row of a query.
|
/// A single result row of a query.
|
||||||
|
///
|
||||||
|
/// A value can be accessed by the name or index of its column, though access
|
||||||
|
/// by index is more efficient.
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// let foo: i32 = row[0];
|
||||||
|
/// let bar: ~str = row["bar"];
|
||||||
|
/// ```
|
||||||
pub struct PostgresRow<'self> {
|
pub struct PostgresRow<'self> {
|
||||||
priv stmt: &'self NormalPostgresStatement<'self>,
|
priv stmt: &'self NormalPostgresStatement<'self>,
|
||||||
priv data: ~[Option<~[u8]>]
|
priv data: ~[Option<~[u8]>]
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self> Container for PostgresRow<'self> {
|
impl<'self> Container for PostgresRow<'self> {
|
||||||
|
#[inline]
|
||||||
fn len(&self) -> uint {
|
fn len(&self) -> uint {
|
||||||
self.data.len()
|
self.data.len()
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ macro_rules! check_types(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/// A trait for things that can be created from a Postgres value
|
/// A trait for types that can be created from a Postgres value
|
||||||
pub trait FromSql {
|
pub trait FromSql {
|
||||||
/// Creates a new value of this type from a buffer of Postgres data.
|
/// Creates a new value of this type from a buffer of Postgres data.
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user