pub struct rustls_slice_str<'a> { /* private fields */ }
Expand description
A read-only view of a slice of multiple Rust &str
’s (that is, multiple
strings).
Like rustls_str
, this guarantees that each string contains
UTF-8 and no NUL bytes. Strings are not NUL-terminated.
This is used to pass data from rustls-ffi to callback functions provided
by the user of the API. Because Vec and slice are not #[repr(C)]
, we
can’t provide a straightforward data
and len
structure. Instead, we
provide access via a pointer to an opaque struct and accessor methods.
Internally, the pointee is a &[&str]
.
The memory exposed is available as specified by the function using this in its signature. For instance, when this is a parameter to a callback, the lifetime will usually be the duration of the callback. Functions that receive one of these must not call its methods beyond the allowed lifetime.