DeviceRepository

public protocol DeviceRepository<T> : Sendable

Protocol defining device operations.

  • T

    Declaration

    Swift

    associatedtype T
  • get() Asynchronous

    Retrieves a list of devices.

    Declaration

    Swift

    func get() async -> Result<[T], DeviceError>

    Return Value

    A Result containing either the list of devices or an error.

  • delete(_:) Asynchronous

    Deletes the specified device.

    Declaration

    Swift

    func delete(_ device: T) async -> Result<T, DeviceError>

    Parameters

    device

    The device to delete.

    Return Value

    A Result containing either success (T) or an error.

  • update(_:) Asynchronous

    Updates the specified device.

    Declaration

    Swift

    func update(_ device: T) async -> Result<T, DeviceError>

    Parameters

    device

    The device to update.

    Return Value

    A Result containing either success (T) or an error.