acl: Add PartialEq for the structs
This commit is contained in:
parent
f1294480b0
commit
c3cc8a2bd5
1 changed files with 15 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
use serde_derive::Deserialize;
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[derive(Deserialize, PartialEq, Debug)]
|
||||
pub struct ACLEntry {
|
||||
pub username: String,
|
||||
pub resource: String,
|
||||
|
@ -20,6 +20,20 @@ pub struct ResourceShortcuts {
|
|||
pub id: i8,
|
||||
}
|
||||
|
||||
impl PartialEq for AuthMethod {
|
||||
fn eq(&self, other: &Self) -> bool{
|
||||
(self.method == other.method)
|
||||
&& (self.identifier == other.identifier)
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for ResourceShortcuts {
|
||||
fn eq(&self, other: &Self) -> bool{
|
||||
(self.username == other.username)
|
||||
&& (self.id == other.id)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ACL {
|
||||
/// `Option`s on delete operations mean that all associated data is removed
|
||||
/// ACLEntry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue