Skip to content

Commit 30e1368

Browse files
authored
CDRIVER-3362 update documentation for non-owning return values (#864)
1 parent e430a9b commit 30e1368

8 files changed

+31
-13
lines changed

src/libmongoc/doc/mongoc_client_session_get_client.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ Synopsis
1111
mongoc_client_t *
1212
mongoc_client_session_get_client (const mongoc_client_session_t *session);
1313
14-
Returns the :symbol:`mongoc_client_t` from which this session was created with :symbol:`mongoc_client_start_session()`.
14+
Returns the :symbol:`mongoc_client_t` from which this session was created. See :symbol:`mongoc_client_start_session()`.
1515

1616
Parameters
1717
----------
1818

1919
* ``session``: A :symbol:`mongoc_client_session_t`.
2020

21+
Returns
22+
-------
23+
24+
A :symbol:`mongoc_client_t` that should not be freed.
25+
2126
.. only:: html
2227

2328
.. include:: includes/seealso/session.txt

src/libmongoc/doc/mongoc_client_session_get_cluster_time.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Synopsis
1111
const bson_t *
1212
mongoc_client_session_get_cluster_time (const mongoc_client_session_t *session);
1313
14-
Get the session's clusterTime, as a BSON document.
14+
Get the session's clusterTime as a BSON document.
1515

1616
Parameters
1717
----------
@@ -21,7 +21,7 @@ Parameters
2121
Returns
2222
-------
2323

24-
A :symbol:`bson:bson_t` you must not modify or free. If the session has not been used for any operation and you have not called :symbol:`mongoc_client_session_advance_cluster_time`, then the returned value is NULL.
24+
If the session has not been used for any operation and :symbol:`mongoc_client_session_advance_cluster_time()` has not been called, a :symbol:`bson:bson_t` that is valid only for the lifetime of ``session``. Otherwise, ``NULL``.
2525

2626
.. only:: html
2727

src/libmongoc/doc/mongoc_client_session_get_lsid.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Synopsis
1111
const bson_t *
1212
mongoc_client_session_get_lsid (mongoc_client_session_t *session);
1313
14-
Get the server-side "logical session ID" associated with this :symbol:`mongoc_client_session_t`, as a BSON document.
14+
Get the server-side "logical session ID" associated with this :symbol:`mongoc_client_session_t` as a BSON document.
1515

1616
Parameters
1717
----------
@@ -21,7 +21,7 @@ Parameters
2121
Returns
2222
-------
2323

24-
A :symbol:`bson:bson_t` you must not modify or free.
24+
A :symbol:`bson:bson_t` that is valid only for the lifetime of ``session``.
2525

2626
.. only:: html
2727

src/libmongoc/doc/mongoc_client_session_get_opts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Parameters
2121
Returns
2222
-------
2323

24-
A :symbol:`mongoc_session_opt_t` you must not modify or free.
24+
A :symbol:`mongoc_session_opt_t` that is valid only for the lifetime of ``session``.
2525

2626
.. only:: html
2727

src/libmongoc/doc/mongoc_session_opts_get_default_transaction_opts.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Synopsis
1111
const mongoc_transaction_opt_t *
1212
mongoc_session_opts_get_default_transaction_opts (const mongoc_session_opt_t *opts);
1313
14-
The default options for transactions started with this session.
14+
The default options for transactions started with this session. See :symbol:`mongoc_session_opts_set_default_transaction_opts()`.
1515

1616
Parameters
1717
----------
@@ -21,9 +21,7 @@ Parameters
2121
Returns
2222
-------
2323

24-
A :symbol:`mongoc_transaction_opt_t` which should not be modified or freed.
25-
26-
See :symbol:`mongoc_session_opts_set_default_transaction_opts()`.
24+
A :symbol:`mongoc_transaction_opt_t` that is valid only for the lifetime of ``opts``.
2725

2826
.. only:: html
2927

src/libmongoc/doc/mongoc_transaction_opts_get_read_concern.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ Synopsis
1111
const mongoc_read_concern_t *
1212
mongoc_transaction_opts_get_read_concern (const mongoc_transaction_opt_t *opts);
1313
14-
Return the transaction options' :symbol:`mongoc_read_concern_t`. The returned value is valid only for the lifetime of ``opts``. See :symbol:`mongoc_transaction_opts_set_read_concern()`.
14+
Return the transaction options' :symbol:`mongoc_read_concern_t`. See :symbol:`mongoc_transaction_opts_set_read_concern()`.
1515

1616
Parameters
1717
----------
1818

1919
* ``opts``: A :symbol:`mongoc_transaction_opt_t`.
2020

21+
Returns
22+
-------
23+
24+
A :symbol:`mongoc_read_concern_t` that is valid only for the lifetime of ``opts``.
25+
2126
.. only:: html
2227

2328
.. include:: includes/seealso/session.txt

src/libmongoc/doc/mongoc_transaction_opts_get_read_prefs.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ Synopsis
1111
const mongoc_read_prefs_t *
1212
mongoc_transaction_opts_get_read_prefs (const mongoc_transaction_opt_t *opts);
1313
14-
Return the transaction options' :symbol:`mongoc_read_prefs_t`. The returned value is valid only for the lifetime of ``opts``. See :symbol:`mongoc_transaction_opts_set_read_prefs()`.
14+
Return the transaction options' :symbol:`mongoc_read_prefs_t`. See :symbol:`mongoc_transaction_opts_set_read_prefs()`.
1515

1616
Parameters
1717
----------
1818

1919
* ``opts``: A :symbol:`mongoc_transaction_opt_t`.
2020

21+
Returns
22+
-------
23+
24+
A :symbol:`mongoc_read_prefs_t` that is valid only for the lifetime of ``opts``.
25+
2126
.. only:: html
2227

2328
.. include:: includes/seealso/session.txt

src/libmongoc/doc/mongoc_transaction_opts_get_write_concern.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ Synopsis
1111
const mongoc_write_concern_t *
1212
mongoc_transaction_opts_get_write_concern (const mongoc_transaction_opt_t *opts);
1313
14-
Return the transaction options' :symbol:`mongoc_write_concern_t`. The returned value is valid only for the lifetime of ``opts``. See :symbol:`mongoc_transaction_opts_set_write_concern()`.
14+
Return the transaction options' :symbol:`mongoc_write_concern_t`. See :symbol:`mongoc_transaction_opts_set_write_concern()`.
1515

1616
Parameters
1717
----------
1818

1919
* ``opts``: A :symbol:`mongoc_transaction_opt_t`.
2020

21+
Returns
22+
-------
23+
24+
A :symbol:`mongoc_write_concern_t` that is valid only for the lifetime of ``opts``.
25+
2126
.. only:: html
2227

2328
.. include:: includes/seealso/session.txt

0 commit comments

Comments
 (0)