@@ -569,11 +569,11 @@ You call `ProgressManager`'s `subprogress(assigningCount:)` to create a `Subprog
569
569
The callee will consume ` Subprogress ` and get the ` ProgressManager ` by calling ` start(totalCount:) ` . That ` ProgressManager ` is used for the function's own progress updates.
570
570
571
571
``` swift
572
- @available (FoundationPreview 6.3, * )
573
572
/// Subprogress is used to establish parent-child relationship between two instances of `ProgressManager`.
574
573
///
575
574
/// Subprogress is returned from a call to `subprogress(assigningCount:)` by a parent ProgressManager.
576
575
/// A child ProgressManager is then returned by calling `start(totalCount:)` on a Subprogress.
576
+ @available (FoundationPreview 6.3, * )
577
577
public struct Subprogress : ~ Copyable , Sendable {
578
578
579
579
/// Instantiates a ProgressManager which is a child to the parent ProgressManager from which the Subprogress is created.
@@ -881,9 +881,27 @@ extension ProgressManager {
881
881
/// and summary types are `UInt64`. If the property has not been set, the getter returns the
882
882
/// property's default value.
883
883
///
884
- /// - Parameter key: A key path to the custom integer property type.
884
+ /// - Parameter key: A key path to the custom unsigned integer property type.
885
885
public subscript <P : Property >(dynamicMember key : KeyPath<ProgressManager.Properties, P.Type >) -> UInt64 where P.Value == UInt64 , P.Summary == UInt64 { get set }
886
-
886
+
887
+ /// Gets or sets custom UInt64 properties.
888
+ ///
889
+ /// This subscript provides read-write access to custom progress properties where the value
890
+ /// type is `UInt64` and the summary type is `[UInt64]`. If the property has not been set,
891
+ /// the getter returns the property's default value.
892
+ ///
893
+ /// - Parameter key: A key path to the custom unsigned integer property type.
894
+ public subscript <P : Property >(dynamicMember key : KeyPath<ProgressManager.Properties, P.Type >) -> UInt64 where P.Value == UInt64 , P.Summary == [UInt64 ] { get set }
895
+
896
+ /// Gets or sets custom duration properties.
897
+ ///
898
+ /// This subscript provides read-write access to custom progress properties where both the value
899
+ /// and summary types are `Duration`. If the property has not been set, the getter returns the
900
+ /// property's default value.
901
+ ///
902
+ /// - Parameter key: A key path to the custom duration property type.
903
+ public subscript <P : Property >(dynamicMember key : KeyPath<ProgressManager.Properties, P.Type >) -> Duration where P.Value == Duration, P.Summary == Duration { get set }
904
+
887
905
/// Gets or sets custom double properties.
888
906
///
889
907
/// This subscript provides read-write access to custom progress properties where both the value
@@ -910,24 +928,6 @@ extension ProgressManager {
910
928
///
911
929
/// - Parameter key: A key path to the custom URL property type.
912
930
public subscript <P : Property >(dynamicMember key : KeyPath<ProgressManager.Properties, P.Type >) -> URL? where P.Value == URL? , P.Summary == [URL? ] { get set }
913
-
914
- /// Gets or sets custom UInt64 properties.
915
- ///
916
- /// This subscript provides read-write access to custom progress properties where the value
917
- /// type is `UInt64` and the summary type is `[UInt64]`. If the property has not been set,
918
- /// the getter returns the property's default value.
919
- ///
920
- /// - Parameter key: A key path to the custom UInt64 property type.
921
- public subscript <P : Property >(dynamicMember key : KeyPath<ProgressManager.Properties, P.Type >) -> UInt64 where P.Value == UInt64 , P.Summary == [UInt64 ] { get set }
922
-
923
- /// Gets or sets custom duration properties.
924
- ///
925
- /// This subscript provides read-write access to custom progress properties where both the value
926
- /// and summary types are `Duration`. If the property has not been set, the getter returns the
927
- /// property's default value.
928
- ///
929
- /// - Parameter key: A key path to the custom double property type.
930
- public subscript <P : Property >(dynamicMember key : KeyPath<ProgressManager.Properties, P.Type >) -> Duration where P.Value == Duration, P.Summary == Duration { get set }
931
931
}
932
932
}
933
933
```
@@ -957,7 +957,27 @@ extension ProgressManager {
957
957
/// where both the value and summary types are `UInt64`.
958
958
/// - Returns: An `UInt64` summary value for the specified property.
959
959
public func summary <P : Property >(of property : P.Type ) -> P.Summary where P.Value == UInt64 , P.Summary == UInt64
960
-
960
+
961
+ /// Returns a summary for a custom unsigned integer property across the progress subtree.
962
+ ///
963
+ /// This method aggregates the values of a custom unsigned integer property from this progress manager
964
+ /// and all its children, returning a consolidated summary value as an array of unsigned integer values.
965
+ ///
966
+ /// - Parameter property: The type of the unsigned integer property to summarize. Must be a property
967
+ /// where the value type is `UInt64` and the summary type is `[UInt64]`.
968
+ /// - Returns: A `[UInt64]` summary value for the specified property.
969
+ public func summary <P : Property >(of property : P.Type ) -> P.Summary where P.Value == UInt64 , P.Summary == [UInt64 ]
970
+
971
+ /// Returns a summary for a custom duration property across the progress subtree.
972
+ ///
973
+ /// This method aggregates the values of a custom duration property from this progress manager
974
+ /// and all its children, returning a consolidated summary value.
975
+ ///
976
+ /// - Parameter property: The type of the duration property to summarize. Must be a property
977
+ /// where both the value and summary types are `Duration`.
978
+ /// - Returns: An `Duration` summary value for the specified property.
979
+ public func summary <P : Property >(of property : P.Type ) -> P.Summary where P.Value == Duration, P.Summary == Duration
980
+
961
981
/// Returns a summary for a custom double property across the progress subtree.
962
982
///
963
983
/// This method aggregates the values of a custom double property from this progress manager
@@ -987,26 +1007,6 @@ extension ProgressManager {
987
1007
/// where the value type is `URL?` and the summary type is `[URL?]`.
988
1008
/// - Returns: A `[URL?]` summary value for the specified property.
989
1009
public func summary <P : Property >(of property : P.Type ) -> P.Summary where P.Value == URL? , P.Summary == [URL? ]
990
-
991
- /// Returns a summary for a custom UInt64 property across the progress subtree.
992
- ///
993
- /// This method aggregates the values of a custom UInt64 property from this progress manager
994
- /// and all its children, returning a consolidated summary value as an array of UInt64 values.
995
- ///
996
- /// - Parameter property: The type of the UInt64 property to summarize. Must be a property
997
- /// where the value type is `UInt64` and the summary type is `[UInt64]`.
998
- /// - Returns: A `[UInt64]` summary value for the specified property.
999
- public func summary <P : Property >(of property : P.Type ) -> P.Summary where P.Value == UInt64 , P.Summary == [UInt64 ]
1000
-
1001
- /// Returns a summary for a custom duration property across the progress subtree.
1002
- ///
1003
- /// This method aggregates the values of a custom integer property from this progress manager
1004
- /// and all its children, returning a consolidated summary value.
1005
- ///
1006
- /// - Parameter property: The type of the integer property to summarize. Must be a property
1007
- /// where both the value and summary types are `Duration`.
1008
- /// - Returns: An `Duration` summary value for the specified property.
1009
- public func summary <P : Property >(of property : P.Type ) -> P.Summary where P.Value == Duration, P.Summary == Duration
1010
1010
}
1011
1011
```
1012
1012
@@ -1015,10 +1015,10 @@ extension ProgressManager {
1015
1015
` ProgressReporter ` is a read-only instance of its underlying ` ProgressManager ` . It is also used as an adapter to add a ` ProgressManager ` as a child to more than one parent ` ProgressManager ` by calling the ` assign(count:to:) ` method on a parent ` ProgressManager ` .
1016
1016
1017
1017
``` swift
1018
- @available (FoundationPreview 6.3, * )
1019
1018
/// ProgressReporter is used to observe progress updates from a `ProgressManager`. It may also be used to incorporate those updates into another `ProgressManager`.
1020
1019
///
1021
1020
/// It is read-only and can be added as a child of another ProgressManager.
1021
+ @available (FoundationPreview 6.3, * )
1022
1022
@Observable public final class ProgressReporter : Sendable , Hashable , Equatable , CustomStringConvertible , CustomDebugStringConvertible {
1023
1023
1024
1024
/// The total units of work.
@@ -1064,14 +1064,34 @@ extension ProgressManager {
1064
1064
1065
1065
/// Returns a summary for a custom unsigned integer property across the progress subtree.
1066
1066
///
1067
- /// This method aggregates the values of a custom integer property from the underlying progress manager
1067
+ /// This method aggregates the values of a custom unsigned integer property from the underlying progress manager
1068
1068
/// and all its children, returning a consolidated summary value.
1069
1069
///
1070
- /// - Parameter property: The type of the integer property to summarize. Must be a property
1070
+ /// - Parameter property: The type of the unsigned integer property to summarize. Must be a property
1071
1071
/// where both the value and summary types are `UInt64`.
1072
1072
/// - Returns: An `UInt64` summary value for the specified property.
1073
1073
public func summary <P : ProgressManager.Property >(of property : P.Type ) -> UInt64 where P.Value == UInt64 , P.Summary == UInt64
1074
-
1074
+
1075
+ /// Returns a summary for a custom unsigned integer property across the progress subtree.
1076
+ ///
1077
+ /// This method aggregates the values of a custom unsigned integer property from the underlying progress manager
1078
+ /// and all its children, returning a consolidated summary value as an array of unsigned integer values.
1079
+ ///
1080
+ /// - Parameter property: The type of the unsigned integer property to summarize. Must be a property
1081
+ /// where the value type is `UInt64` and the summary type is `[UInt64]`.
1082
+ /// - Returns: A `[UInt64]` summary value for the specified property.
1083
+ public func summary <P : ProgressManager.Property >(of property : P.Type ) -> [UInt64 ] where P.Value == UInt64 , P.Summary == [UInt64 ]
1084
+
1085
+ /// Returns a summary for a custom duration property across the progress subtree.
1086
+ ///
1087
+ /// This method aggregates the values of a custom duration property from the underlying progress manager
1088
+ /// and all its children, returning a consolidated summary value.
1089
+ ///
1090
+ /// - Parameter property: The type of the duration property to summarize. Must be a property
1091
+ /// where both the value and summary types are `Duration`.
1092
+ /// - Returns: An `Duraton` summary value for the specified property.
1093
+ public func summary <P : ProgressManager.Property >(of property : P.Type ) -> Duration where P.Value == Duration, P.Summary == Duration
1094
+
1075
1095
/// Returns a summary for a custom double property across the progress subtree.
1076
1096
///
1077
1097
/// This method aggregates the values of a custom double property from the underlying progress manager
@@ -1102,26 +1122,6 @@ extension ProgressManager {
1102
1122
/// where the value type is `URL?` and the summary type is `[URL?]`.
1103
1123
/// - Returns: A `[URL?]` summary value for the specified property.
1104
1124
public func summary <P : ProgressManager.Property >(of property : P.Type ) -> [URL? ] where P.Value == URL? , P.Summary == [URL? ]
1105
-
1106
- /// Returns a summary for a custom UInt64 property across the progress subtree.
1107
- ///
1108
- /// This method aggregates the values of a custom UInt64 property from the underlying progress manager
1109
- /// and all its children, returning a consolidated summary value as an array of UInt64 values.
1110
- ///
1111
- /// - Parameter property: The type of the UInt64 property to summarize. Must be a property
1112
- /// where the value type is `UInt64` and the summary type is `[UInt64]`.
1113
- /// - Returns: A `[UInt64]` summary value for the specified property.
1114
- public func summary <P : ProgressManager.Property >(of property : P.Type ) -> [UInt64 ] where P.Value == UInt64 , P.Summary == [UInt64 ]
1115
-
1116
- /// Returns a summary for a custom duration property across the progress subtree.
1117
- ///
1118
- /// This method aggregates the values of a custom integer property from the underlying progress manager
1119
- /// and all its children, returning a consolidated summary value.
1120
- ///
1121
- /// - Parameter property: The type of the integer property to summarize. Must be a property
1122
- /// where both the value and summary types are `Duration`.
1123
- /// - Returns: An `Duraton` summary value for the specified property.
1124
- public func summary <P : ProgressManager.Property >(of property : P.Type ) -> Duration where P.Value == Duration, P.Summary == Duration
1125
1125
}
1126
1126
```
1127
1127
0 commit comments