pub struct ContextBuilder { /* private fields */ }Expand description
A Type that knows how to construct a Context.
Implementations§
Source§impl ContextBuilder
impl ContextBuilder
Sourcepub fn registration(self, val: &str) -> Result<Self, DataError>
pub fn registration(self, val: &str) -> Result<Self, DataError>
Set the registration field from an &str.
Raise DataError if the input string is empty.
Sourcepub fn registration_uuid(self, uuid: Uuid) -> Result<Self, DataError>
pub fn registration_uuid(self, uuid: Uuid) -> Result<Self, DataError>
Set the registration field from a UUID value.
Raise DataError if the input string is empty.
Sourcepub fn instructor(self, val: Actor) -> Result<Self, DataError>
pub fn instructor(self, val: Actor) -> Result<Self, DataError>
Sourcepub fn context_activities(
self,
val: ContextActivities,
) -> Result<Self, DataError>
pub fn context_activities( self, val: ContextActivities, ) -> Result<Self, DataError>
Set the context_activities field.
Raise DataError if the ContextActivities argument is invalid.
Sourcepub fn context_agent(self, val: ContextAgent) -> Result<Self, DataError>
pub fn context_agent(self, val: ContextAgent) -> Result<Self, DataError>
Add a ContextAgent to context_agents field.
Raise DataError if the ContextAgent argument is invalid.
Sourcepub fn context_group(self, val: ContextGroup) -> Result<Self, DataError>
pub fn context_group(self, val: ContextGroup) -> Result<Self, DataError>
Add a ContextGroup to context_groups field.
Raise DataError if the ContextGroup argument is invalid.
Sourcepub fn revision<S: Deref<Target = str>>(self, val: S) -> Result<Self, DataError>
pub fn revision<S: Deref<Target = str>>(self, val: S) -> Result<Self, DataError>
Set the revision field.
Raise DataError if the input string is empty.
Sourcepub fn platform<S: Deref<Target = str>>(self, val: S) -> Result<Self, DataError>
pub fn platform<S: Deref<Target = str>>(self, val: S) -> Result<Self, DataError>
Set the platform field.
Raise DataError if the input string is empty.
Sourcepub fn language<S: Deref<Target = str>>(self, val: S) -> Result<Self, DataError>
pub fn language<S: Deref<Target = str>>(self, val: S) -> Result<Self, DataError>
Set the language field.
Raise DataError if the input string is empty.
Sourcepub fn statement(self, val: StatementRef) -> Result<Self, DataError>
pub fn statement(self, val: StatementRef) -> Result<Self, DataError>
Set the statement field from given StatementRef instance.
Raise DataError if the argument is invalid.
Sourcepub fn statement_uuid(self, uuid: Uuid) -> Result<Self, DataError>
pub fn statement_uuid(self, uuid: Uuid) -> Result<Self, DataError>
Set the statement field from a Statement’s UUID.
Raise DataError if the argument is invalid.
Sourcepub fn extension(self, key: &str, value: &Value) -> Result<Self, DataError>
pub fn extension(self, key: &str, value: &Value) -> Result<Self, DataError>
Add to extensions an entry w/ (key, value) pair.
Raise DataError if the key is empty.
Sourcepub fn with_extensions(self, map: Extensions) -> Result<Self, DataError>
pub fn with_extensions(self, map: Extensions) -> Result<Self, DataError>
Set (as in replace) the extensions property of this instance w/ the
given argument.