pub trait AttributesWriter {
// Required methods
fn set_id(&mut self, id: impl Into<String>) -> String;
fn set_source(&mut self, source: impl Into<UriReference>) -> UriReference;
fn set_type(&mut self, ty: impl Into<String>) -> String;
fn set_subject(
&mut self,
subject: Option<impl Into<String>>,
) -> Option<String>;
fn set_time(
&mut self,
time: Option<impl Into<DateTime<Utc>>>,
) -> Option<DateTime<Utc>>;
fn set_datacontenttype(
&mut self,
datacontenttype: Option<impl Into<String>>,
) -> Option<String>;
fn set_dataschema(
&mut self,
dataschema: Option<impl Into<Url>>,
) -> Option<Url>;
}
Expand description
Trait to set CloudEvents Context attributes.
Required Methods§
Sourcefn set_source(&mut self, source: impl Into<UriReference>) -> UriReference
fn set_source(&mut self, source: impl Into<UriReference>) -> UriReference
Set the source. Returns the previous value.
Sourcefn set_type(&mut self, ty: impl Into<String>) -> String
fn set_type(&mut self, ty: impl Into<String>) -> String
Set the type. Returns the previous value.
Sourcefn set_subject(&mut self, subject: Option<impl Into<String>>) -> Option<String>
fn set_subject(&mut self, subject: Option<impl Into<String>>) -> Option<String>
Set the subject. Returns the previous value.
Sourcefn set_time(
&mut self,
time: Option<impl Into<DateTime<Utc>>>,
) -> Option<DateTime<Utc>>
fn set_time( &mut self, time: Option<impl Into<DateTime<Utc>>>, ) -> Option<DateTime<Utc>>
Set the time. Returns the previous value.
Sourcefn set_datacontenttype(
&mut self,
datacontenttype: Option<impl Into<String>>,
) -> Option<String>
fn set_datacontenttype( &mut self, datacontenttype: Option<impl Into<String>>, ) -> Option<String>
Set the datacontenttype. Returns the previous value.
Sourcefn set_dataschema(&mut self, dataschema: Option<impl Into<Url>>) -> Option<Url>
fn set_dataschema(&mut self, dataschema: Option<impl Into<Url>>) -> Option<Url>
Set the dataschema. Returns the previous value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.