pub enum Transport {
MockHttp,
HttpRandomPort,
HttpIpPort {
ip: Option<IpAddr>,
port: Option<u16>,
},
}
Expand description
Transport is for setting which transport mode for the TestServer
to use when making requests.
Variants§
MockHttp
With this transport mode, TestRequest
will use a mock HTTP
transport.
This is the Default Transport type.
HttpRandomPort
With this transport mode, a real web server will be spun up
running on a random port. Requests made using the TestRequest
will be made over the network stack.
HttpIpPort
With this transport mode, a real web server will be spun up. Where you can pick which IP and Port to use for this to bind to.
Setting both ip
and port
to None
, is the equivalent of
using Transport::HttpRandomPort
.
Trait Implementations§
source§impl PartialEq for Transport
impl PartialEq for Transport
impl Copy for Transport
impl StructuralPartialEq for Transport
Auto Trait Implementations§
impl Freeze for Transport
impl RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnwindSafe for Transport
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