Other Protocols

The following protocols are available globally.

  • Types conforming to this protocol provide persistence metadata.

    The code generator will make your Entity types conform to this for you and implement the requirements.

    See more

    Declaration

    Swift

    public protocol EntityInspectable
  • Protocol an ObjectBox ID must conform to. Currently, there are two major types that can be used as IDs:

    • EntityId<E> which is a generic, type-safe ID struct
    • Id (or Int64) which is a simpler data type usable for IDs. Most methods that require you to specify an ID accept either type of ID.

    Also used to constrain extensions:

    extension Property where ValueType: IdBase { … }

    (Swift doesn’t have parameterized extensions, or else we could write where ValueType == EntityId<T>.)

    See more

    Declaration

    Swift

    public protocol IdBase : EntityPropertyTypeConvertible, Hashable
  • A type that is usable as an object ID that doesn’t enforce the type of entity it is for.

    Declaration

    Swift

    public protocol UntypedIdBase : IdBase
  • The code generator generates concrete instances of EntityBinding objects that perform the actual work of transferring database values into your Swift objects and extracting them for writing out.

    As an ObjectBox user, you don’t need to deal with this (directly).

    See more

    Declaration

    Swift

    public protocol EntityBinding : AnyObject
  • Listens to login events.

    See more

    Declaration

    Swift

    public protocol SyncLoginListener
  • Listens to sync completed events.

    See more

    Declaration

    Swift

    public protocol SyncCompletedListener
  • Notifies of fine granular changes on the object level happening during sync.

    Note

    Enabling fine granular notification can slightly reduce performance.

    See also SyncCompletedListener for the general sync listener.

    Declaration

    Swift

    public protocol SyncChangeListener
  • Listens to sync connection events.

    See more

    Declaration

    Swift

    public protocol SyncConnectionListener
  • Listens to all possible sync events. See each protocol for detailed information.

    Declaration