pub struct SclRequest<'a, T: SclObject> {
pub obj_name: Option<String>,
pub sc_name: Option<String>,
pub body: Option<&'a T>,
pub query: &'a [(&'a str, &'a str)],
}Expand description
A builder to construct a request object that can be used with the SclClient.
All members are optional and can be omitted. Specify them to create more complex requests.
§Examples
use scl_lib::api_objects::VirtualMachine;
use scl_lib::client::SclRequest;
let req = SclRequest::<VirtualMachine>::new()
.obj_name("vm-01")
.sc("sc-01")
.query(&[("node", "node-01")]);Fields§
§obj_name: Option<String>§sc_name: Option<String>§body: Option<&'a T>§query: &'a [(&'a str, &'a str)]Implementations§
Source§impl<'a, T: SclObject> SclRequest<'a, T>
impl<'a, T: SclObject> SclRequest<'a, T>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates and initializes a new SclRequest object.
Sourcepub fn obj_name(self, name: &str) -> Self
pub fn obj_name(self, name: &str) -> Self
Sets the name of the request object to use as T::path()/<name> when constructing the URL.
Sourcepub fn sc(self, sc_name: &str) -> Self
pub fn sc(self, sc_name: &str) -> Self
Sets the name of the the separation context to use as /scs/<sc_name> when constructing
the URL.
Trait Implementations§
Source§impl<'a, T: Clone + SclObject> Clone for SclRequest<'a, T>
impl<'a, T: Clone + SclObject> Clone for SclRequest<'a, T>
Source§fn clone(&self) -> SclRequest<'a, T>
fn clone(&self) -> SclRequest<'a, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a, T> Freeze for SclRequest<'a, T>
impl<'a, T> RefUnwindSafe for SclRequest<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SclRequest<'a, T>where
T: Sync,
impl<'a, T> Sync for SclRequest<'a, T>where
T: Sync,
impl<'a, T> Unpin for SclRequest<'a, T>
impl<'a, T> UnwindSafe for SclRequest<'a, T>where
T: RefUnwindSafe,
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