pub enum StatementObject {
Agent(Agent),
Group(Group),
StatementRef(StatementRef),
SubStatement(Box<SubStatement>),
Activity(Activity),
}Expand description
Enumeration representing the subject (or target) of an action (a Verb) carried out by an Actor (an Agent or a Group) captured in a Statement.
The exact variant of the object is gleaned –explicitly most of the times
but implicitly in special cases– from its objectType property value (a
variant of ObjectType).
IMPORTANT (rsn) - xAPI (Section 4.2.2 Statement, as well as 4.2.2.3 Object for the Object As Sub-Statement Table) define the Object of a Statement as “Activity, Agent, or another Statement that is the Object of the Statement.” only. However, other sections of the same document mention it can also be a Group. Conformance tests, show that this is the case and that it applies for both Statement and SubStatement.
Variants§
Agent(Agent)
The object is an Agent.
Group(Group)
The object is a Group.
StatementRef(StatementRef)
The object is a Statement-Reference.
SubStatement(Box<SubStatement>)
The object is a Sub-Statement.
Activity(Activity)
The object is an Activity.
Implementations§
Source§impl StatementObject
impl StatementObject
Sourcepub fn from_activity(obj: Activity) -> Self
pub fn from_activity(obj: Activity) -> Self
Construct a variant from the given Activity instance.
Sourcepub fn from_agent(obj: Agent) -> Self
pub fn from_agent(obj: Agent) -> Self
Construct a variant from the given Agent instance.
Sourcepub fn from_group(obj: Group) -> Self
pub fn from_group(obj: Group) -> Self
Construct a variant from the given Group instance]
Sourcepub fn from_statement_ref(obj: StatementRef) -> Self
pub fn from_statement_ref(obj: StatementRef) -> Self
Construct a variant from the given StatementRef instance.
Sourcepub fn from_sub_statement(obj: SubStatement) -> Self
pub fn from_sub_statement(obj: SubStatement) -> Self
Construct a variant from the given SubStatement instance.
Sourcepub fn is_activity(&self) -> bool
pub fn is_activity(&self) -> bool
Return TRUE if this is an Activity variant or FALSE otherwise.
Sourcepub fn is_statement_ref(&self) -> bool
pub fn is_statement_ref(&self) -> bool
Return TRUE if this is an StatementRef variant or FALSE otherwise.
Sourcepub fn is_sub_statement(&self) -> bool
pub fn is_sub_statement(&self) -> bool
Return TRUE if this is a SubStatement variant or FALSE otherwise.
Sourcepub fn as_activity(&self) -> Result<Activity, DataError>
pub fn as_activity(&self) -> Result<Activity, DataError>
Return the target Activity if it was set; None otherwise.
Sourcepub fn as_statement_ref(&self) -> Result<StatementRef, DataError>
pub fn as_statement_ref(&self) -> Result<StatementRef, DataError>
Return the target if it was a Statement-Reference. Raise DataError otherwise.
Sourcepub fn as_sub_statement(&self) -> Result<SubStatement, DataError>
pub fn as_sub_statement(&self) -> Result<SubStatement, DataError>
Return the target if it was a Sub-Statement. Raise DataError otherwise.
Trait Implementations§
Source§impl Debug for StatementObject
impl Debug for StatementObject
Source§impl<'de> Deserialize<'de> for StatementObject
impl<'de> Deserialize<'de> for StatementObject
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>,
Source§impl Display for StatementObject
impl Display for StatementObject
Source§impl Fingerprint for StatementObject
impl Fingerprint for StatementObject
Source§impl PartialEq for StatementObject
impl PartialEq for StatementObject
Source§fn eq(&self, other: &StatementObject) -> bool
fn eq(&self, other: &StatementObject) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for StatementObject
impl Serialize for StatementObject
Source§impl Validate for StatementObject
impl Validate for StatementObject
Source§fn validate(&self) -> Vec<ValidationError>
fn validate(&self) -> Vec<ValidationError>
Source§fn is_valid(&self) -> bool
fn is_valid(&self) -> bool
Source§fn check_validity(&self) -> Result<(), ValidationError>
fn check_validity(&self) -> Result<(), ValidationError>
impl StructuralPartialEq for StatementObject
Auto Trait Implementations§
impl Freeze for StatementObject
impl RefUnwindSafe for StatementObject
impl Send for StatementObject
impl Sync for StatementObject
impl Unpin for StatementObject
impl UnsafeUnpin for StatementObject
impl UnwindSafe for StatementObject
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.