Lines Matching defs:Credential
28 pub struct Credential(Opaque<bindings::cred>);
31 // - `Credential::dec_ref` can be called from any thread.
32 // - It is okay to send ownership of `Credential` across thread boundaries.
33 unsafe impl Send for Credential {}
35 // SAFETY: It's OK to access `Credential` through shared references from other threads because
37 unsafe impl Sync for Credential {}
39 impl Credential {
40 /// Creates a reference to a [`Credential`] from a valid pointer.
45 /// returned [`Credential`] reference.
47 pub unsafe fn from_ptr<'a>(ptr: *const bindings::cred) -> &'a Credential {
49 // `Credential` type being transparent makes the cast ok.
78 // SAFETY: The type invariants guarantee that `Credential` is always ref-counted.
79 unsafe impl AlwaysRefCounted for Credential {
87 unsafe fn dec_ref(obj: core::ptr::NonNull<Credential>) {
89 // because `Credential` has the same representation as `struct cred`.