-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
RESP3TokenDecoder
into its own file (#75)
- Loading branch information
1 parent
ae9f06b
commit 95b2d06
Showing
2 changed files
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the RediStack open source project | ||
// | ||
// Copyright (c) 2023 RediStack project authors | ||
// Licensed under Apache License v2.0 | ||
// | ||
// See LICENSE.txt for license information | ||
// See CONTRIBUTORS.txt for the list of RediStack project authors | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import NIOCore | ||
|
||
public struct RESP3TokenDecoder: NIOSingleStepByteToMessageDecoder { | ||
public typealias InboundOut = RESP3Token | ||
|
||
public init() {} | ||
|
||
public mutating func decode(buffer: inout ByteBuffer) throws -> RESP3Token? { | ||
try RESP3Token(consuming: &buffer) | ||
} | ||
|
||
public mutating func decodeLast(buffer: inout ByteBuffer, seenEOF _: Bool) throws -> RESP3Token? { | ||
try self.decode(buffer: &buffer) | ||
} | ||
} |