pub struct ContractBuilder { /* private fields */ }Expand description
Contract builder
Implementations§
Source§impl ContractBuilder
impl ContractBuilder
Sourcepub fn new(consumer: impl Into<String>, provider: impl Into<String>) -> Self
pub fn new(consumer: impl Into<String>, provider: impl Into<String>) -> Self
Create new contract builder
§Examples
use armature_testing::contract::*;
let builder = ContractBuilder::new("MyConsumer", "MyProvider");Sourcepub fn add_interaction(&mut self, interaction: ContractInteraction) -> &mut Self
pub fn add_interaction(&mut self, interaction: ContractInteraction) -> &mut Self
Add interaction
§Examples
use armature_testing::contract::*;
let request = ContractRequest::new(ContractMethod::Get, "/api/users/1");
let response = ContractResponse::new(200)
.with_body(serde_json::json!({"id": 1, "name": "Alice"}));
let mut builder = ContractBuilder::new("Frontend", "Backend");
builder.add_interaction(ContractInteraction::new(
"get user by ID",
request,
response,
));Auto Trait Implementations§
impl Freeze for ContractBuilder
impl RefUnwindSafe for ContractBuilder
impl Send for ContractBuilder
impl Sync for ContractBuilder
impl Unpin for ContractBuilder
impl UnsafeUnpin for ContractBuilder
impl UnwindSafe for ContractBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging