#[non_exhaustive]pub enum PeerError {
Unsupported(&'static str),
Mismatch(PeerIdentity),
Query(Error),
Unreadable {
pid: Option<u32>,
image: Option<PathBuf>,
kind: PeerFailureKind,
source: Error,
},
}Expand description
Why a peer was not accepted as the current user.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unsupported(&'static str)
This platform cannot authenticate the peer, so no peer is accepted.
Mismatch(PeerIdentity)
The peer is a different user.
Query(Error)
The OS could not tell who the peer is (including a peer that already left).
Unreadable
The peer process was found but the OS would not let this process read its identity. It
carries what is known about the process so a host can say which program was refused
(rightkit#1287). On Windows this is the usual answer for a client at a higher integrity
level (an elevated process) than a medium-integrity server: the pid and image path are
still readable (PeerFailureKind::Elevated) and the refusal is right, only the missing
identity was the problem.
Fields
image: Option<PathBuf>The peer’s executable path, when it could be read (Windows QueryFullProcessImageNameW
works with PROCESS_QUERY_LIMITED_INFORMATION even for an elevated client).
kind: PeerFailureKindA stable kind a host can switch on instead of parsing text.
Implementations§
Source§impl PeerError
impl PeerError
Sourcepub fn failure_kind(&self) -> Option<PeerFailureKind>
pub fn failure_kind(&self) -> Option<PeerFailureKind>
The stable kind of an unreadable peer; None for the other errors.
Trait Implementations§
Source§impl Error for PeerError
impl Error for PeerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()