DeviceRepository
public protocol DeviceRepository<T> : Sendable
Protocol defining device operations.
-
Declaration
Swift
associatedtype T -
get()AsynchronousRetrieves 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
deviceThe 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
deviceThe device to update.
Return Value
A Result containing either success (T) or an error.
View on GitHub