小编ElK*_*PoN的帖子

无返回的异步/等待函数 | 雨燕5.5

如何从函数中删除 Bool 返回而不出现错误:

Generic parameter 'T' could not be inferred
Run Code Online (Sandbox Code Playgroud)

这是函数:

private func syncDataStore() async throws -> Bool {
    try await withUnsafeThrowingContinuation { continuation in
        Amplify.DataStore.stop { (result) in
            switch(result) {
            case .success:
                Amplify.DataStore.start { (result) in
                    switch(result) {
                    case .success:
                        print("DataStore started")
                        continuation.resume(returning: true)
                    case .failure(let error):
                        print("Error starting DataStore:\(error)")
                        continuation.resume(throwing: error)
                    }
                }
            case .failure(let error):
                print("Error stopping DataStore:\(error)")
                continuation.resume(throwing: error)
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这就是我尝试做的,但我收到上面提到的错误:

private func syncDataStore() async throws {
    try await withUnsafeThrowingContinuation { continuation in …
Run Code Online (Sandbox Code Playgroud)

swift swiftui

14
推荐指数
2
解决办法
5319
查看次数

删除 AWS 云形成堆栈及其创建的资源

基于这个页面我可以做:

aws cloudformation delete-stack \
    --stack-name my-stack
Run Code Online (Sandbox Code Playgroud)

它说我可以附加命令: [--retain-resources <value>]

这是否意味着如果我不指定该行,堆栈创建的所有资源都将被删除?我试图删除堆栈生成的所有内容,数量很多。

我怎样才能实现这个目标?

谢谢

amazon-web-services aws-cloudformation aws-cli aws-cloudformation-custom-resource

6
推荐指数
1
解决办法
8812
查看次数