pub fn create(config: Option<Config>) -> WasmEdgeResult<Self> {
        let ctx = match config {
            Some(mut config) => {
                let ctx = unsafe { wasmedge::WasmEdge_LoaderCreate(config.inner.0) };
                config.inner.0 = std::ptr::null_mut();
                ctx
            }
            None => unsafe { wasmedge::WasmEdge_LoaderCreate(std::ptr::null_mut()) },
        };

        match ctx.is_null() {
            true => Err(WasmEdgeError::LoaderCreate),
            false => Ok(Self {
                inner: InnerLoader(ctx),
            }),
        }
    }
/// Create a new [`Loader`] to be associated with the given global configuration.
///
/// # Arguements
///
/// - `config` specifies a global configuration.
///
/// # Error
///
/// If fail to create a [`Loader`], then an error is returned.
Create a new [`Loader`] to be associated with the given global configuration.
Create a new [ ` Loader ` ] to be associated with the given global configuration .
pub fn create(config: Option<Config>) -> WasmEdgeResult<Self> {
        let ctx = match config {
            Some(mut config) => {
                let ctx = unsafe { wasmedge::WasmEdge_LoaderCreate(config.inner.0) };
                config.inner.0 = std::ptr::null_mut();
                ctx
            }
            None => unsafe { wasmedge::WasmEdge_LoaderCreate(std::ptr::null_mut()) },
        };
        match ctx.is_null() {
            true => Err(WasmEdgeError::LoaderCreate),
            false => Ok(Self {
                inner: InnerLoader(ctx),
            }),
        }
    }
pub fn create ( config : Option < Config > ) -> WasmEdgeResult < Self > { let ctx = match config { Some ( mut config ) => { let ctx = unsafe { wasmedge :: WasmEdge_LoaderCreate ( config . inner . 0 ) } ; config . inner . 0 = std :: ptr :: null_mut ( ) ; ctx } None => unsafe { wasmedge :: WasmEdge_LoaderCreate ( std :: ptr :: null_mut ( ) ) } , } ; match ctx . is_null ( ) { true => Err ( WasmEdgeError :: LoaderCreate ) , false => Ok ( Self { inner : InnerLoader ( ctx ) , } ) , } }
Create a new [`Loader`] to be associated with the given global configuration.
Create a new [ ` Loader ` ] to be associated with the given global configuration .
config
Option<Config>
config
Option<Config>
arguements
`config` specifies a global configuration.
` config ` specifies a global configuration .
error
If fail to create a [`Loader`], then an error is returned.
If fail to create a [ ` Loader ` ] then an error is returned .