pub fn build<'a, T, I>(mut self, init: I) -> Result<Application<'a, T>>
    where
        S: State<T> + 'a,
        I: DataInit<T>,
    {
        trace!("Entering `ApplicationBuilder::build`");

        #[cfg(feature = "profiler")]
        register_thread_with_profiler("Main".into());
        #[cfg(feature = "profiler")]
        profile_scope!("new");

        let reader_id = self.world
            .write_resource::<EventChannel<Event>>()
            .register_reader();

        let data = init.build(&mut self.world);

        Ok(Application {
            world: self.world,
            states: StateMachine::new(self.initial_state),
            events_reader_id: reader_id,
            ignore_window_close: self.ignore_window_close,
            data,
        })
    }
/// Build an `Application` object using the `ApplicationBuilder` as configured.
///
/// # Returns
///
/// This function returns an Application object wrapped in the Result type.
///
/// # Errors
///
/// This function currently will not produce an error, returning a result
/// type was strictly for future possibilities.
///
/// # Notes
///
/// If the "profiler" feature is used, this function will register the thread
/// that executed this function as the "Main" thread.
///
/// # Examples
///
/// See the [example show for `ApplicationBuilder::new()`](struct.ApplicationBuilder.html#examples)
/// for an example on how this method is used.
Build an `Application` object using the `ApplicationBuilder` as configured.
Build an ` Application ` object using the ` ApplicationBuilder ` as configured .
pub fn build<'a, T, I>(mut self, init: I) -> Result<Application<'a, T>>
    where
        S: State<T> + 'a,
        I: DataInit<T>,
    {
        trace!("Entering `ApplicationBuilder::build`");
        #[cfg(feature = "profiler")]
        register_thread_with_profiler("Main".into());
        #[cfg(feature = "profiler")]
        profile_scope!("new");
        let reader_id = self.world
            .write_resource::<EventChannel<Event>>()
            .register_reader();
        let data = init.build(&mut self.world);
        Ok(Application {
            world: self.world,
            states: StateMachine::new(self.initial_state),
            events_reader_id: reader_id,
            ignore_window_close: self.ignore_window_close,
            data,
        })
    }
pub fn build < ' a , T , I > ( mut self , init : I ) -> Result < Application < ' a , T > > where S : State < T > + ' a , I : DataInit < T > , { trace ! ( " " ) ; # [ cfg ( feature " " ) ] register_thread_with_profiler ( " " . into ( ) ) ; # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; let reader_id = self . world . write_resource :: < EventChannel < Event > > ( ) . register_reader ( ) ; let data = init . build ( & mut self . world ) ; Ok ( Application { world : self . world , states : StateMachine :: new ( self . initial_state ) , events_reader_id : reader_id , ignore_window_close : self . ignore_window_close , data , } ) }
Build an `Application` object using the `ApplicationBuilder` as configured.
Build an ` Application ` object using the ` ApplicationBuilder ` as configured .
mut self
init
I
This function returns an Application object wrapped in the Result type.
This function returns an Application object wrapped in the Result type .
mut self
init
I
errors
This function currently will not produce an error, returning a result
type was strictly for future possibilities.
This function currently will not produce an error returning a result type was strictly for future possibilities .
notes
If the "profiler" feature is used, this function will register the thread
that executed this function as the "Main" thread.
If the " profiler " feature is used this function will register the thread that executed this function as the " Main " thread .
examples
See the [example show for `ApplicationBuilder::new()`](struct.ApplicationBuilder.html#examples)
for an example on how this method is used.
See the [ example show for ` ApplicationBuilder :: new () ` ] ( struct . ApplicationBuilder . html#examples ) for an example on how this method is used .