pub enum ServiceDefinition {
Ok(JValue),
Error(CallServiceResult),
SeqOk {
call_number_seq: Cell<usize>,
call_map: HashMap<String, JValue>,
},
SeqError {
call_number_seq: Cell<usize>,
call_map: HashMap<String, CallServiceResult>,
},
Behaviour(Behavior),
DbgBehaviour(Behavior),
Map(HashMap<String, JValue>),
}
Expand description
Service definition in the testing framework comment DSL.
Variants§
Ok(JValue)
Simple service that returns same value
Error(CallServiceResult)
Simple service that returns same call result (i.e. may return a error)
SeqOk
Service that may return a new value on subsequent call. Its keys are either call number string starting from “0”, or “default”.
SeqError
Behaviour(Behavior)
Some known service by name: “echo”, “unit” (more to follow).
DbgBehaviour(Behavior)
Same services as defined by the enum element above with dbg! applied to the arguments.
Map(HashMap<String, JValue>)
Maps first argument to a value
Implementations§
source§impl ServiceDefinition
impl ServiceDefinition
pub fn ok(value: JValue) -> Self
pub fn error(value: CallServiceResult) -> Self
pub fn seq_ok(call_map: HashMap<String, JValue>) -> Self
pub fn seq_error(call_map: HashMap<String, CallServiceResult>) -> Self
pub fn behaviour(name: Behavior) -> Self
pub fn map(map: HashMap<String, JValue>) -> Self
pub async fn call(&self, params: CallRequestParams) -> CallServiceResult
Trait Implementations§
source§impl Clone for ServiceDefinition
impl Clone for ServiceDefinition
source§fn clone(&self) -> ServiceDefinition
fn clone(&self) -> ServiceDefinition
Returns a copy 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 moresource§impl Debug for ServiceDefinition
impl Debug for ServiceDefinition
source§impl<'_enum> From<&'_enum ServiceDefinition> for ServiceTagName
impl<'_enum> From<&'_enum ServiceDefinition> for ServiceTagName
source§fn from(val: &'_enum ServiceDefinition) -> ServiceTagName
fn from(val: &'_enum ServiceDefinition) -> ServiceTagName
Converts to this type from the input type.
source§impl From<ServiceDefinition> for ServiceTagName
impl From<ServiceDefinition> for ServiceTagName
source§fn from(val: ServiceDefinition) -> ServiceTagName
fn from(val: ServiceDefinition) -> ServiceTagName
Converts to this type from the input type.
source§impl FromStr for ServiceDefinition
impl FromStr for ServiceDefinition
source§impl PartialEq for ServiceDefinition
impl PartialEq for ServiceDefinition
source§fn eq(&self, other: &ServiceDefinition) -> bool
fn eq(&self, other: &ServiceDefinition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ServiceDefinition
impl StructuralPartialEq for ServiceDefinition
Auto Trait Implementations§
impl !Freeze for ServiceDefinition
impl !RefUnwindSafe for ServiceDefinition
impl Send for ServiceDefinition
impl !Sync for ServiceDefinition
impl Unpin for ServiceDefinition
impl UnwindSafe for ServiceDefinition
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.