rename method, update comments

This commit is contained in:
yggverse 2024-12-01 04:49:10 +02:00
parent 8f910672e2
commit 6330bbfd85
2 changed files with 6 additions and 4 deletions

View file

@ -113,7 +113,7 @@ impl Client {
} }
} }
/// Middle-level method to make new request to `Connection` /// Middle-level helper, makes new request to available `Connection`
/// * callback with new `Response` on success or `Error` on failure /// * callback with new `Response` on success or `Error` on failure
pub fn request_async( pub fn request_async(
connection: Connection, connection: Connection,
@ -128,7 +128,7 @@ pub fn request_async(
Some(&cancellable.clone()), Some(&cancellable.clone()),
move |result| match result { move |result| match result {
Ok(_) => { Ok(_) => {
Response::from_request_async(connection, priority, cancellable, move |result| { Response::from_connection_async(connection, priority, cancellable, move |result| {
callback(match result { callback(match result {
Ok(response) => Ok(response), Ok(response) => Ok(response),
Err(e) => Err(Error::Response(e)), Err(e) => Err(Error::Response(e)),

View file

@ -19,7 +19,9 @@ pub struct Response {
impl Response { impl Response {
// Constructors // Constructors
pub fn from_request_async( /// Create new `Self` from given `Connection`
/// * useful for manual [IOStream](https://docs.gtk.org/gio/class.IOStream.html) handle (based on `Meta` bytes pre-parsed)
pub fn from_connection_async(
connection: Connection, connection: Connection,
priority: Priority, priority: Priority,
cancellable: Cancellable, cancellable: Cancellable,