ya_etcd_rs/auth/
auth_status.rs

1use crate::ResponseHeader;
2use crate::proto::etcdserverpb;
3
4#[derive(Debug, Default, Clone)]
5pub struct AuthStatusRequest {
6    proto: etcdserverpb::AuthStatusRequest,
7}
8
9impl From<AuthStatusRequest> for etcdserverpb::AuthStatusRequest {
10    fn from(req: AuthStatusRequest) -> Self {
11        req.proto
12    }
13}
14
15#[derive(Debug, Clone)]
16pub struct AuthStatusResponse {
17    pub header: ResponseHeader,
18    pub enabled: bool,
19    pub auth_revision: u64,
20}
21
22impl From<etcdserverpb::AuthStatusResponse> for AuthStatusResponse {
23    fn from(proto: etcdserverpb::AuthStatusResponse) -> Self {
24        Self {
25            header: From::from(proto.header.expect("must fetch header")),
26            enabled: proto.enabled,
27            auth_revision: proto.auth_revision,
28        }
29    }
30}