@@ -114,7 +114,7 @@ impl ContainerBuilder {
114114 Ok ( Container {
115115 internal_port : self . internal_port ,
116116 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 )
118118 . with_exposed_port ( self . internal_port )
119119 . with_wait_for ( WaitFor :: Http ( Box :: new (
120120 HttpWaitStrategy :: new ( "/api/v1/ping" )
@@ -137,10 +137,10 @@ impl ContainerBuilder {
137137}
138138
139139/// A running test container for the [EventSourcingDB](https://www.eventsourcingdb.io/).
140- ///
140+ ///
141141/// Aside from managing the container, this struct also provides methods to get the data needed to connect to
142142/// the database or even a fully configured client.
143- ///
143+ ///
144144/// You'll most likely want to use the [`Container::start_default`] method to create a new container instance for your tests.
145145/// For more details, see the [`crate::container`] module documentation.
146146/// ```
@@ -152,7 +152,7 @@ impl ContainerBuilder {
152152/// ```
153153#[ derive( Debug ) ]
154154pub struct Container {
155- container : ContainerAsync < GenericImage > ,
155+ instance : ContainerAsync < GenericImage > ,
156156 internal_port : ContainerPort ,
157157 api_token : String ,
158158}
@@ -167,7 +167,7 @@ impl Container {
167167 }
168168
169169 /// Shortcut method to start the container with default settings.
170- ///
170+ ///
171171 /// This is the same as calling [`Container::builder`] and then [`ContainerBuilder::start`].
172172 /// In most cases this will create a contaienr with the latest image tag and a working configuration.
173173 ///
@@ -178,26 +178,23 @@ impl Container {
178178 }
179179
180180 /// Get the host of the container.
181- ///
181+ ///
182182 /// This is the host that you can use to connect to the database. In most cases this will be `localhost`.
183183 ///
184184 /// # Errors
185185 /// 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
186186 pub async fn get_host ( & self ) -> Result < Host , ContainerError > {
187- Ok ( self . container . get_host ( ) . await ?)
187+ Ok ( self . instance . get_host ( ) . await ?)
188188 }
189189
190190 /// Get the mapped port for the database.
191- ///
191+ ///
192192 /// This is the port that you can use to connect to the database. This will be a random port that is mapped to the internal port configured via [`ContainerBuilder::with_port`].
193193 ///
194194 /// # Errors
195195 /// 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
196196 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 ?)
201198 }
202199
203200 /// Get the complete http base URL for the database.
@@ -227,7 +224,7 @@ impl Container {
227224 /// # Errors
228225 /// This function will return an error if the container could not be stopped.
229226 pub async fn stop ( self ) -> Result < ( ) , ContainerError > {
230- self . container . stop ( ) . await ?;
227+ self . instance . stop ( ) . await ?;
231228 Ok ( ( ) )
232229 }
233230
0 commit comments