@frozen
public struct SyncSubscriptionSet
extension SyncSubscriptionSet: Sequence
SyncSubscriptionSet
is a collection of SyncSubscription
s. This is the entry point for adding and removing SyncSubscription
s.
The number of subscriptions in the subscription set.
DeclarationSwift
public var count: Int { get }
Synchronously performs any transactions (add/remove/update) to the subscription set within the block.
DeclarationSwift
public func update(_ block: (() -> Void), onComplete: (@Sendable (Error?) -> Void)? = nil)
Parameters block
The block containing the subscriptions transactions to perform.
onComplete
The block called upon synchronization of subscriptions to the server. Otherwise an Error
describing what went wrong will be returned by the block
Returns the current state for the subscription set.
Returns a subscription by the specified name.
Parameters named
The name of the subscription searching for.
Return ValueA subscription for the given name.
Returns a subscription by the specified query.
Parameters type
The type of the object to be queried.
where
A query builder that produces a subscription which can be used to search the subscription by query and/or name.
Return ValueA query builder that produces a subscription which can used to search for the subscription.
Returns a subscription by the specified query.
DeclarationSwift
public func first<T>(ofType type: T.Type, where predicateFormat: String, _ args: Any...) -> SyncSubscription? where T : RealmSwiftObject
Parameters type
The type of the object to be queried.
where
A query builder that produces a subscription which can be used to search the subscription by query and/or name.
Return ValueA query builder that produces a subscription which can used to search for the subscription.
Returns a subscription by the specified query.
DeclarationSwift
public func first<T>(ofType type: T.Type, where predicate: NSPredicate) -> SyncSubscription? where T : RealmSwiftObject
Parameters type
The type of the object to be queried.
where
A query builder that produces a subscription which can be used to search the subscription by query and/or name.
Return ValueA query builder that produces a subscription which can used to search for the subscription.
Appends one or several subscriptions to the subscription set.
Warning
This method may only be called during a write subscription block.
DeclarationSwift
public func append<T>(_ subscriptions: QuerySubscription<T>...) where T : RealmSwiftObject
Parameters subscriptions
The subscriptions to be added to the subscription set.
Removes a subscription with the specified query.
Warning
This method may only be called during a write subscription block.
DeclarationSwift
public func remove<T>(ofType type: T.Type, _ query: @escaping (Query<T>) -> Query<Bool>) where T : RealmSwiftObject
Parameters type
The type of the object to be removed.
to
A query for the subscription to be removed from the subscription set.
Removes a subscription with the specified query.
Warning
This method may only be called during a write subscription block.
DeclarationSwift
public func remove<T>(ofType type: T.Type, where predicateFormat: String, _ args: Any...) where T : RealmSwiftObject
Parameters type
The type of the object to be removed.
predicateFormat
A predicate format string, optionally followed by a variable number of arguments, which will be used to identify the subscription to be removed.
Removes a subscription with the specified query.
Warning
This method may only be called during a write subscription block.
DeclarationSwift
public func remove<T>(ofType type: T.Type, where predicate: NSPredicate) where T : RealmSwiftObject
Parameters type
The type of the object to be removed.
predicate
The predicate which will be used to identify the subscription to be removed.
Removes one or several subscriptions from the subscription set.
Warning
This method may only be called during a write subscription block.
Parameters subscription
The subscription to be removed from the subscription set.
Removes a subscription with the specified name from the subscription set.
Warning
This method may only be called during a write subscription block.
DeclarationSwift
public func remove(named: String)
Parameters named
The name of the subscription to be removed from the subscription set.
Removes all subscriptions from the subscription set.
Warning
Warning
DeclarationSwift
public func removeAll(unnamedOnly: Bool = false)
Parameters unnamedOnly
If true, only unnamed subscriptions are removed.
Removes zero or none subscriptions of the given type from the subscription set.
Warning
This method may only be called during a write subscription block.
DeclarationSwift
public func removeAll<T>(ofType type: T.Type) where T : RealmSwiftObject
Parameters type
The type of the objects to be removed.
Returns the subscription at the given position
.
position
The index for the resulting subscription.
Returns the first object in the SyncSubscription list, or nil
if the subscriptions are empty.
Returns the last object in the SyncSubscription list, or nil
if the subscriptions are empty.
Creates and commits a transaction, updating the subscription set, this will continue when the server acknowledge and all the data associated with this collection of subscriptions is synced.
Throws
An NSError
if the subscription set state changes to an error state or there is and error while committing any changes to the subscriptions.
Swift
@MainActor
public func update(_ block: (() -> Void)) async throws
Parameters block
The block containing the subscriptions transactions to perform.
Creates and commit a transaction, updating the subscription set, this will return success when the server acknowledge and all the data associated with this collection of subscriptions is synced.
DeclarationSwift
public func updateSubscriptions(_ block: @escaping (() -> Void)) -> Future<Void, Error>
Parameters block
The block containing the subscriptions transactions to perform.
Return ValueA publisher that eventually returns Result.success
or Error
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4