Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Sources/NIOFoundationCompat/ByteBuffer-foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import NIOCore

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

/// Errors that may be thrown by ByteBuffer methods that call into Foundation.
public enum ByteBufferFoundationError: Error {
/// Attempting to encode the given string failed.
Expand Down
7 changes: 6 additions & 1 deletion Sources/NIOFoundationCompat/Codable+ByteBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import NIOCore

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

extension ByteBuffer {
/// Attempts to decode the `length` bytes from `index` using the `JSONDecoder` `decoder` as `T`.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import NIOCore

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

extension JSONSerialization {

/// Attempts to derive a Foundation object from a ByteBuffer and return it as `T`.
Expand Down
Loading