@@ -114,7 +114,7 @@ impl ContainerBuilder {
114
114
Ok ( Container {
115
115
internal_port : self . internal_port ,
116
116
api_token : self . api_token . clone ( ) ,
117
- container : GenericImage :: new ( self . image_name , self . image_tag )
117
+ instance : GenericImage :: new ( self . image_name , self . image_tag )
118
118
. with_exposed_port ( self . internal_port )
119
119
. with_wait_for ( WaitFor :: Http ( Box :: new (
120
120
HttpWaitStrategy :: new ( "/api/v1/ping" )
@@ -152,7 +152,7 @@ impl ContainerBuilder {
152
152
/// ```
153
153
#[ derive( Debug ) ]
154
154
pub struct Container {
155
- container : ContainerAsync < GenericImage > ,
155
+ instance : ContainerAsync < GenericImage > ,
156
156
internal_port : ContainerPort ,
157
157
api_token : String ,
158
158
}
@@ -184,7 +184,7 @@ impl Container {
184
184
/// # Errors
185
185
/// This function will return an error if the container is not running (e.g. because it crashed) or if the host could not be retrieved
186
186
pub async fn get_host ( & self ) -> Result < Host , ContainerError > {
187
- Ok ( self . container . get_host ( ) . await ?)
187
+ Ok ( self . instance . get_host ( ) . await ?)
188
188
}
189
189
190
190
/// Get the mapped port for the database.
@@ -194,10 +194,7 @@ impl Container {
194
194
/// # Errors
195
195
/// This function will return an error if the container is not running (e.g. because it crashed) or if the host could not be retrieved
196
196
pub async fn get_mapped_port ( & self ) -> Result < u16 , ContainerError > {
197
- Ok ( self
198
- . container
199
- . get_host_port_ipv4 ( self . internal_port )
200
- . await ?)
197
+ Ok ( self . instance . get_host_port_ipv4 ( self . internal_port ) . await ?)
201
198
}
202
199
203
200
/// Get the complete http base URL for the database.
@@ -227,7 +224,7 @@ impl Container {
227
224
/// # Errors
228
225
/// This function will return an error if the container could not be stopped.
229
226
pub async fn stop ( self ) -> Result < ( ) , ContainerError > {
230
- self . container . stop ( ) . await ?;
227
+ self . instance . stop ( ) . await ?;
231
228
Ok ( ( ) )
232
229
}
233
230
0 commit comments