core_y library

Classes

CacheManager<V>
A generic cache manager that supports time-based expiration and group-based management.
Failure<S, E extends AppException>
Represents a failed result containing an error of type E.
A class that manages the expiration of cache entries or groups.
Result<S, E extends AppException>
A type that represents either a success value of type S or a failure value of type E.
Success<S, E extends AppException>
Represents a successful result containing a value of type S.

Enums

SerializationExceptionCode
Enum representing different types of serialization errors.

Typedefs

AsyncFailureCallback<E extends AppException, T> = T Function(E error)
Callback type for failure operations in Result.asyncFold Note: This remains synchronous as error handling typically doesn't need to be async
AsyncResult<S, E extends AppException> = Future<Result<S, E>>
Type alias for asynchronous Result operations
AsyncSuccessCallback<S, T> = Future<T> Function(S value)
Callback type for asynchronous success operations in Result.asyncFold
Cache<V> = Map<String, _CacheValue<V>>
GroupId = String
Key = String
OnExpire = void Function()
A function type that represents an action to be taken when a cache entry expires.
SyncFailureCallback<E extends AppException, T> = T Function(E error)
Callback type for synchronous failure operations in Result.fold
SyncSuccessCallback<S, T> = T Function(S value)
Callback type for synchronous success operations in Result.fold

Exceptions / Errors

AppException
SerializationException
An exception that is thrown when an error occurs during serialization or deserialization.