pub struct SetAddElementsRequest<S: IntoBytes, E: IntoBytesIterable> { /* private fields */ }Expand description
Request to add elements to the given set. Creates the set if it does not exist.
§Arguments
cache_name- The name of the cache containing the set.set_name- The name of the set to add an element to.elements- The elements to add. Must be able to be converted to aVec<u8>.
§Optional Arguments
collection_ttl- The time-to-live for the collection. If not provided, the client’s default time-to-live is used.
§Examples
Assumes that a CacheClient named cache_client has been created and is available.
use momento::cache::{CollectionTtl, SetAddElementsResponse, SetAddElementsRequest};
let set_name = "set";
let add_elements_request = SetAddElementsRequest::new(
cache_name,
set_name,
vec!["value1", "value2"]
).ttl(CollectionTtl::default());
match cache_client.send_request(add_elements_request).await {
Ok(_) => println!("Elements added to set"),
Err(e) => eprintln!("Error adding elements to set: {}", e),
}Implementations§
Source§impl<S: IntoBytes, E: IntoBytesIterable> SetAddElementsRequest<S, E>
impl<S: IntoBytes, E: IntoBytesIterable> SetAddElementsRequest<S, E>
Trait Implementations§
Source§impl<S: IntoBytes, E: IntoBytesIterable> MomentoRequest for SetAddElementsRequest<S, E>
impl<S: IntoBytes, E: IntoBytesIterable> MomentoRequest for SetAddElementsRequest<S, E>
Auto Trait Implementations§
impl<S, E> Freeze for SetAddElementsRequest<S, E>
impl<S, E> RefUnwindSafe for SetAddElementsRequest<S, E>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<S, E> Send for SetAddElementsRequest<S, E>
impl<S, E> Sync for SetAddElementsRequest<S, E>
impl<S, E> Unpin for SetAddElementsRequest<S, E>
impl<S, E> UnsafeUnpin for SetAddElementsRequest<S, E>where
S: UnsafeUnpin,
E: UnsafeUnpin,
impl<S, E> UnwindSafe for SetAddElementsRequest<S, E>where
S: UnwindSafe,
E: UnwindSafe,
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
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> 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::Request