comparison src/items.rs @ 66:a674799a5cd3

Make `PamHandle` and `PamModuleHandle` traits. This creates traits for PAM functionality and pulls the definitions of that functionality out of the original `PamHandle` (renamed to `LibPamHandle`) and into those traits. This supports testing PAM module implementations using mock PAM library implementations. Also uses a better representation of opaque pointers.
author Paul Fisher <paul@pfish.zone>
date Tue, 27 May 2025 14:37:28 -0400
parents d83623951070
children
comparison
equal deleted inserted replaced
65:8e507c7af9cf 66:a674799a5cd3
52 fn from(val: ItemType) -> Self { 52 fn from(val: ItemType) -> Self {
53 val as Self 53 val as Self
54 } 54 }
55 } 55 }
56 56
57 /// A type that can be requested by [`PamHandle::get_item`](crate::PamHandle::get_item). 57 /// A type that can be requested by [`PamHandle::get_item`](crate::LibPamHandle::get_item).
58 pub trait Item { 58 pub trait Item {
59 /// The `repr(C)` type that is returned (by pointer) by the underlying `pam_get_item` function. 59 /// The `repr(C)` type that is returned (by pointer) by the underlying `pam_get_item` function.
60 /// This memory is owned by the PAM session. 60 /// This memory is owned by the PAM session.
61 type Raw; 61 type Raw;
62 62