github untoldwind/KontrolSystem2 v0.5.7.1

latest releases: v0.5.9.5, v0.5.9.4, v0.5.9.3...
pre-release7 months ago

Result<T, E> overhaul.

Background:

  • The main use-case of Result<T, E> is to serve as return of a function that can either have a successful result of
    type T or an error of type E.
  • In pretty much all cases the error is just a string, i.e. the common use is Result<T, string>

Changes:

  • For simplification the type parameter for the error case is dropped, i.e. a result is just Result<T>
    • The old notation Result<T, E> (or rather Result<T, string>) will still work, but the second parameter is ignored
  • The result.error field is now a newly introduced core::error::Error
    • For compatibility core::error::Error will be automatically converted to a string
    • Just like before an error Result can be created using the builtin Err function with an error message
  • In addition to the error message the core::error::Error additional contains a stack_trace to help locating
    where the Error was created
  • As an additional helper there this a core::error::current_stack() function to obtain the current stack trace for
    debugging purposes.

Support for script based logs:

  • Add MAIN_LOG and open_log_file(string) to ksp::debug
    • Log files will be cared ein logs sub-folder of to2Local

Don't miss a new KontrolSystem2 release

NewReleases is sending notifications on new releases.