#[non_exhaustive]pub struct Credentials {
pub pid: Option<ProcessId>,
pub same_user: bool,
pub user_evidence: UserEvidence,
}Expand description
What the operating system reports about the other end of one connection.
Read them while the connection is open and before dispatching anything.
Later fields, such as a code-signature result, will be added without a
breaking change; construct them with Credentials::new.
Equality compares pid and same_user only. user_evidence says where
same_user came from; compare it explicitly when it matters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.pid: Option<ProcessId>Kernel-reported PID of the peer, or None when the platform reports none.
same_user: boolWhether the peer runs as this process’s OS user.
user_evidence: UserEvidenceWhere same_user came from.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub const fn new(pid: Option<ProcessId>, same_user: bool) -> Self
pub const fn new(pid: Option<ProcessId>, same_user: bool) -> Self
Credentials from an OS query, or for a consumer’s own tests and sources.
The user check is taken to come from the connection; see
Self::with_user_evidence.
Sourcepub const fn with_user_evidence(self, evidence: UserEvidence) -> Self
pub const fn with_user_evidence(self, evidence: UserEvidence) -> Self
The same credentials, with same_user coming from evidence.