Struct kanidm_proto::messages::AccountChangeMessage
source · pub struct AccountChangeMessage {
pub output_mode: ConsoleOutputMode,
pub action: String,
pub result: String,
pub status: MessageStatus,
pub src_user: String,
pub dest_user: String,
}
Fields§
§output_mode: ConsoleOutputMode
§action: String
§result: String
§status: MessageStatus
§src_user: String
§dest_user: String
Trait Implementations§
source§impl Debug for AccountChangeMessage
impl Debug for AccountChangeMessage
source§impl Default for AccountChangeMessage
impl Default for AccountChangeMessage
source§impl<'de> Deserialize<'de> for AccountChangeMessage
impl<'de> Deserialize<'de> for AccountChangeMessage
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for AccountChangeMessage
impl Display for AccountChangeMessage
This outputs in either JSON or Text depending on the output_mode setting
use std::fmt::format;
use kanidm_proto::messages::*;
let mut msg = AccountChangeMessage::default();
msg.action=String::from("cake_eating");
msg.src_user=String::from("Kani");
msg.dest_user=String::from("Krabby");
msg.result=String::from("It was amazing");
assert_eq!(msg.status, MessageStatus::Success);
let expected_result = "success - cake_eating for Krabby: It was amazing";
assert_eq!(format!("{}", msg), expected_result);
msg.output_mode = ConsoleOutputMode::JSON;
let expected_result = "{\"action\":\"cake_eating\",\"result\":\"It was amazing\",\"status\":\"success\",\"src_user\":\"Kani\",\"dest_user\":\"Krabby\"}";
assert_eq!(format!("{}", msg), expected_result);
Auto Trait Implementations§
impl Freeze for AccountChangeMessage
impl RefUnwindSafe for AccountChangeMessage
impl Send for AccountChangeMessage
impl Sync for AccountChangeMessage
impl Unpin for AccountChangeMessage
impl UnwindSafe for AccountChangeMessage
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more