You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Wrapper for [`init`] and [`shutdown`]. Instantiating this at the top of your script will initialize everything correctly and then clean itself up at exit as well.
287
-
pubstructSession{}
287
+
pubstructSession{
288
+
/// lock that don't allow the user to create a session directly
289
+
_lock: std::marker::PhantomData<()>,
290
+
}
288
291
289
292
implSession{
290
293
/// Get a registered [`Session`] for use.
291
294
///
292
295
/// This is required so that we can keep track of the [`SESSION_COUNT`].
293
-
fnregistered_session() -> Self{
294
-
let _previous_count = SESSION_COUNT.fetch_add(1,SeqCst);
295
-
Self{}
296
+
fnregister_session(
297
+
options:Option<InitializationOptions>,
298
+
) -> Result<Self,InitializationError>{
299
+
// if we were able to locate a license, continue with initialization.
300
+
iflicense_location().is_none(){
301
+
// otherwise you must call [Self::new_with_license].
302
+
returnErr(InitializationError::NoLicenseFound);
303
+
}
304
+
305
+
// This is required so that we call init only once
0 commit comments