Mercurial > crates > nonstick
comparison src/pam_ffi/response.rs @ 72:47eb242a4f88
Fill out the PamHandle trait.
This updates the PamHandle trait to have methods for each Item,
and implements them on the LibPamHandle.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Wed, 04 Jun 2025 03:53:36 -0400 |
parents | 58f9d2a4df38 |
children | ac6881304c78 |
comparison
equal
deleted
inserted
replaced
71:58f9d2a4df38 | 72:47eb242a4f88 |
---|---|
134 /// Allocates an owned list of responses on the C heap. | 134 /// Allocates an owned list of responses on the C heap. |
135 fn alloc(count: usize) -> Self { | 135 fn alloc(count: usize) -> Self { |
136 OwnedResponses { | 136 OwnedResponses { |
137 // SAFETY: We are doing allocation here. | 137 // SAFETY: We are doing allocation here. |
138 base: unsafe { libc::calloc(count, size_of::<RawResponse>()) } as *mut RawResponse, | 138 base: unsafe { libc::calloc(count, size_of::<RawResponse>()) } as *mut RawResponse, |
139 count: count, | 139 count, |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 /// Takes ownership of a list of responses allocated on the C heap. | 143 /// Takes ownership of a list of responses allocated on the C heap. |
144 /// | 144 /// |