#[non_exhaustive]pub struct ActionLog {
pub actor: String,
pub state: State,
pub state_metadata: HashMap<String, String>,
pub recommendation_name: String,
/* private fields */
}Expand description
Log content of an action on a recommendation. This includes Mark* actions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.actor: StringRequired. User that executed this action. Eg, foo@gmail.com
state: StateRequired. State change that was made by the actor. Eg, SUCCEEDED.
state_metadata: HashMap<String, String>Optional. Metadata that was included with the action that was taken.
recommendation_name: StringRequired. Name of the recommendation which was acted on. Eg, : ‘projects/123/locations/global/recommenders/roleReco/recommendations/r1’
Implementations§
Source§impl ActionLog
impl ActionLog
Sourcepub fn set_state_metadata<T, K, V>(self, v: T) -> Self
pub fn set_state_metadata<T, K, V>(self, v: T) -> Self
Sets the value of state_metadata.
§Example
ⓘ
let x = ActionLog::new().set_state_metadata([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_recommendation_name<T: Into<String>>(self, v: T) -> Self
pub fn set_recommendation_name<T: Into<String>>(self, v: T) -> Self
Sets the value of recommendation_name.
§Example
ⓘ
let x = ActionLog::new().set_recommendation_name("example");Trait Implementations§
impl StructuralPartialEq for ActionLog
Auto Trait Implementations§
impl Freeze for ActionLog
impl RefUnwindSafe for ActionLog
impl Send for ActionLog
impl Sync for ActionLog
impl Unpin for ActionLog
impl UnsafeUnpin for ActionLog
impl UnwindSafe for ActionLog
Blanket Implementations§
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