Finish documenting everything

This commit is contained in:
Steven Fackler
2019-08-01 18:40:14 -07:00
parent 5dccb9988a
commit 785205ffb2
3 changed files with 18 additions and 6 deletions

View File

@@ -120,6 +120,10 @@ pub(crate) struct SocketConfig {
pub keepalives_idle: Duration,
}
/// An asynchronous PostgreSQL client.
///
/// The client is one half of what is returned when a connection is established. Users interact with the database
/// through this client object.
pub struct Client {
inner: Arc<InnerClient>,
socket_config: Option<SocketConfig>,

View File

@@ -76,11 +76,6 @@ where
}
}
/// Returns the value of a runtime parameter for this connection.
pub fn parameter(&self, name: &str) -> Option<&str> {
self.parameters.get(name).map(|s| &**s)
}
fn poll_response(
&mut self,
cx: &mut Context<'_>,
@@ -291,6 +286,15 @@ where
}
}
/// Returns the value of a runtime parameter for this connection.
pub fn parameter(&self, name: &str) -> Option<&str> {
self.parameters.get(name).map(|s| &**s)
}
/// Polls for asynchronous messages from the server.
///
/// The server can send notices as well as notifications asynchronously to the client. Applications that wish to
/// examine those messages should use this method to drive the connection rather than its `Future` implementation.
pub fn poll_message(
&mut self,
cx: &mut Context<'_>,
@@ -319,7 +323,7 @@ where
type Output = Result<(), Error>;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>> {
while let Some(_) = ready!(Pin::as_mut(&mut self).poll_message(cx)?) {}
while let Some(_) = ready!(self.poll_message(cx)?) {}
Poll::Ready(Ok(()))
}
}

View File

@@ -23,6 +23,9 @@ impl Drop for StatementInner {
}
}
/// A prepared statement.
///
/// Prepared statements can only be used with the connection that created them.
#[derive(Clone)]
pub struct Statement(Arc<StatementInner>);
@@ -56,6 +59,7 @@ impl Statement {
}
}
/// Information about a column of a query.
#[derive(Debug)]
pub struct Column {
name: String,