pub struct EventArgsBuilder { /* private fields */ }Expand description
Builder for EventArgs.
This builder provides a fluent API to construct an EventArgs instance,
ensuring that all required fields are provided.
§Example
ⓘ
let args = EventArgsBuilder::new(
EventName::ObjectCreatedPut,
"my-bucket",
object_info,
)
.host("localhost:9000")
.user_agent("my-app/1.0")
.build();Implementations§
Source§impl EventArgsBuilder
impl EventArgsBuilder
Sourcepub fn new(
event_name: EventName,
bucket_name: impl Into<String>,
object: impl Into<NotifyObjectInfo>,
) -> Self
pub fn new( event_name: EventName, bucket_name: impl Into<String>, object: impl Into<NotifyObjectInfo>, ) -> Self
Creates a new builder with the required fields.
Sourcepub fn event_name(self, event_name: EventName) -> Self
pub fn event_name(self, event_name: EventName) -> Self
Sets the event name.
Sourcepub fn bucket_name(self, bucket_name: impl Into<String>) -> Self
pub fn bucket_name(self, bucket_name: impl Into<String>) -> Self
Sets the bucket name.
Sourcepub fn object(self, object: impl Into<NotifyObjectInfo>) -> Self
pub fn object(self, object: impl Into<NotifyObjectInfo>) -> Self
Sets the object information.
Sourcepub fn req_params(self, req_params: HashMap<String, String>) -> Self
pub fn req_params(self, req_params: HashMap<String, String>) -> Self
Sets the request parameters.
Sourcepub fn req_param(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn req_param(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds a single request parameter.
Sourcepub fn resp_elements(self, resp_elements: HashMap<String, String>) -> Self
pub fn resp_elements(self, resp_elements: HashMap<String, String>) -> Self
Sets the response elements.
Sourcepub fn resp_element(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn resp_element( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds a single response element.
Sourcepub fn version_id(self, version_id: impl Into<String>) -> Self
pub fn version_id(self, version_id: impl Into<String>) -> Self
Sets the version ID.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Sets the user agent.
Trait Implementations§
Source§impl Clone for EventArgsBuilder
impl Clone for EventArgsBuilder
Source§impl Debug for EventArgsBuilder
impl Debug for EventArgsBuilder
Auto Trait Implementations§
impl Freeze for EventArgsBuilder
impl RefUnwindSafe for EventArgsBuilder
impl Send for EventArgsBuilder
impl Sync for EventArgsBuilder
impl Unpin for EventArgsBuilder
impl UnsafeUnpin for EventArgsBuilder
impl UnwindSafe for EventArgsBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.