Skip to content

Commit b691d32

Browse files
author
Joshua Nelson
committed
Use TpToken::default() for examples
1 parent e9bd44f commit b691d32

File tree

3 files changed

+98
-98
lines changed

3 files changed

+98
-98
lines changed

src/context_api/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl Context {
273273
/// # Examples
274274
/// Rollback a transaction if an operation fails:
275275
/// ```
276-
/// use yottadb::{YDB_NOTTP, TransactionStatus};
276+
/// use yottadb::{TpToken, TransactionStatus};
277277
/// use yottadb::context_api::{Context, KeyContext};
278278
///
279279
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -290,7 +290,7 @@ impl Context {
290290
/// } else {
291291
/// b"initial value"
292292
/// };
293-
/// assert_eq!(var.get_st(YDB_NOTTP, Vec::new())?, expected_val);
293+
/// assert_eq!(var.get_st(TpToken::default(), Vec::new())?, expected_val);
294294
/// # Ok(())
295295
/// # }
296296
///
@@ -305,7 +305,7 @@ impl Context {
305305
///
306306
/// Retry a transaction until it succeeds:
307307
/// ```
308-
/// use yottadb::{YDB_NOTTP, TransactionStatus};
308+
/// use yottadb::{TpToken, TransactionStatus};
309309
/// use yottadb::context_api::Context;
310310
///
311311
/// let ctx = Context::new();
@@ -374,7 +374,7 @@ impl Context {
374374
///
375375
/// ```
376376
/// # fn main() -> yottadb::YDBResult<()> {
377-
/// use yottadb::{YDB_NOTTP, YDB_ERR_LVUNDEF};
377+
/// use yottadb::{TpToken, YDB_ERR_LVUNDEF};
378378
/// use yottadb::context_api::{Context, KeyContext};
379379
///
380380
/// // Create three variables and set all
@@ -424,7 +424,7 @@ impl Context {
424424
/// # use yottadb::YDBError;
425425
/// # fn main() -> Result<(), YDBError> {
426426
/// use yottadb::context_api::Context;
427-
/// use yottadb::YDB_NOTTP;
427+
/// use yottadb::TpToken;
428428
///
429429
/// let ctx = Context::new();
430430
/// assert_eq!(ctx.str2zwr("💖".as_bytes())?, b"\"\xf0\"_$C(159,146,150)");
@@ -457,7 +457,7 @@ impl Context {
457457
/// ```
458458
/// # use yottadb::YDBError;
459459
/// # fn main() -> Result<(), YDBError> {
460-
/// use yottadb::YDB_NOTTP;
460+
/// use yottadb::TpToken;
461461
/// use yottadb::context_api::Context;
462462
///
463463
/// let ctx = Context::new();
@@ -529,7 +529,7 @@ impl Context {
529529
/// ```
530530
/// use std::slice;
531531
/// use std::time::Duration;
532-
/// use yottadb::YDB_NOTTP;
532+
/// use yottadb::TpToken;
533533
/// use yottadb::context_api::{Context, KeyContext};
534534
/// use yottadb::simple_api::Key;
535535
///
@@ -592,7 +592,7 @@ impl Context {
592592
/// # Example
593593
/// Look up the error message for an undefined local variable:
594594
/// ```
595-
/// use yottadb::{YDB_NOTTP, YDB_ERR_LVUNDEF};
595+
/// use yottadb::{TpToken, YDB_ERR_LVUNDEF};
596596
/// use yottadb::context_api::{Context, KeyContext};
597597
///
598598
/// let ctx = Context::new();

src/simple_api/call_in.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ pub struct CallInTableDescriptor(usize);
5959
/// ```
6060
/// # fn main() -> yottadb::YDBResult<()> {
6161
/// use std::ffi::CString;
62-
/// use yottadb::{simple_api::call_in, YDB_NOTTP};
62+
/// use yottadb::{simple_api::call_in, TpToken};
6363
///
6464
/// let file = CString::new("examples/m-ffi/calltab.ci").unwrap();
65-
/// let descriptor = call_in::ci_tab_open_t(YDB_NOTTP, Vec::new(), &file)?;
65+
/// let descriptor = call_in::ci_tab_open_t(TpToken::default(), Vec::new(), &file)?;
6666
/// # Ok(())
6767
/// # }
6868
pub fn ci_tab_open_t(
@@ -99,10 +99,10 @@ pub fn ci_tab_open_t(
9999
/// ```
100100
/// # fn main() -> yottadb::YDBResult<()> {
101101
/// use std::ffi::CString;
102-
/// use yottadb::{simple_api::call_in, YDB_NOTTP};
102+
/// use yottadb::{simple_api::call_in, TpToken};
103103
/// let file = CString::new("examples/m-ffi/calltab.ci").unwrap();
104-
/// let (descriptor, err_buf) = call_in::ci_tab_open_t(YDB_NOTTP, Vec::new(), &file)?;
105-
/// let old_ci_table = call_in::ci_tab_switch_t(YDB_NOTTP, err_buf, descriptor)?;
104+
/// let (descriptor, err_buf) = call_in::ci_tab_open_t(TpToken::default(), Vec::new(), &file)?;
105+
/// let old_ci_table = call_in::ci_tab_switch_t(TpToken::default(), err_buf, descriptor)?;
106106
/// # Ok(())
107107
/// # }
108108
/// ```
@@ -142,7 +142,7 @@ pub fn ci_tab_switch_t(
142142
/// ```
143143
/// use std::env;
144144
/// use std::ffi::CString;
145-
/// use yottadb::{craw, ci_t, YDB_NOTTP};
145+
/// use yottadb::{craw, ci_t, TpToken};
146146
///
147147
/// env::set_var("ydb_routines", "examples/m-ffi");
148148
/// env::set_var("ydb_ci", "examples/m-ffi/calltab.ci");
@@ -151,7 +151,7 @@ pub fn ci_tab_switch_t(
151151
/// let mut msg = craw::ydb_string_t { length: 100, address: buf.as_mut_ptr() as *mut i8 };
152152
/// let routine = CString::new("HelloWorld1").unwrap();
153153
/// unsafe {
154-
/// ci_t!(YDB_NOTTP, Vec::with_capacity(100), &routine, &mut msg as *mut _).unwrap();
154+
/// ci_t!(TpToken::default(), Vec::with_capacity(100), &routine, &mut msg as *mut _).unwrap();
155155
/// buf.set_len(msg.length as usize);
156156
/// }
157157
/// assert_eq!(&buf, b"entry called");
@@ -233,7 +233,7 @@ impl Drop for CallInDescriptor {
233233
/// ```
234234
/// use std::env;
235235
/// use std::ffi::CString;
236-
/// use yottadb::{craw, cip_t, CallInDescriptor, YDB_NOTTP};
236+
/// use yottadb::{craw, cip_t, CallInDescriptor, TpToken};
237237
///
238238
/// env::set_var("ydb_routines", "examples/m-ffi");
239239
/// env::set_var("ydb_ci", "examples/m-ffi/calltab.ci");
@@ -242,7 +242,7 @@ impl Drop for CallInDescriptor {
242242
/// let mut msg = craw::ydb_string_t { length: 100, address: buf.as_mut_ptr() as *mut i8 };
243243
/// let mut routine = CallInDescriptor::new(CString::new("HelloWorld1").unwrap());
244244
/// unsafe {
245-
/// cip_t!(YDB_NOTTP, Vec::with_capacity(100), &mut routine, &mut msg as *mut _).unwrap();
245+
/// cip_t!(TpToken::default(), Vec::with_capacity(100), &mut routine, &mut msg as *mut _).unwrap();
246246
/// buf.set_len(msg.length as usize);
247247
/// }
248248
/// assert_eq!(&buf, b"entry called");

0 commit comments

Comments
 (0)