File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ defmodule GRPC.Client.Adapter do
1414
1515 @ callback disconnect ( channel :: Channel . t ( ) ) :: { :ok , Channel . t ( ) } | { :error , any ( ) }
1616
17- @ callback send_request ( stream :: Stream . t ( ) , contents :: binary ( ) , opts :: keyword ( ) ) ::
17+ @ callback send_request ( stream :: Stream . t ( ) , contents :: iodata ( ) , opts :: keyword ( ) ) ::
1818 Stream . t ( )
1919
2020 @ doc """
@@ -36,7 +36,7 @@ defmodule GRPC.Client.Adapter do
3636 Opts:
3737 - :send_end_stream (optional) - ends the request stream
3838 """
39- @ callback send_data ( stream :: Stream . t ( ) , message :: binary ( ) , opts :: keyword ( ) ) :: Stream . t ( )
39+ @ callback send_data ( stream :: Stream . t ( ) , message :: iodata ( ) , opts :: keyword ( ) ) :: Stream . t ( )
4040
4141 @ doc """
4242 Similarly to the option sent on `send_data/2` - :send_end_stream -
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ defmodule GRPC.Codec do
55
66 @ doc ~s( Name is identity of the codec, which will be suffix after content-type "application/grpc+" such as "proto".)
77 @ callback name ( ) :: String . t ( )
8- @ callback encode ( any ) :: binary
8+ @ callback encode ( any ) :: iodata ( )
99 @ callback decode ( any , module :: atom ) :: any
1010
1111 @ doc """
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ defmodule GRPC.Codec.Proto do
55 "proto"
66 end
77
8- def encode ( % mod { } = struct ) do
9- mod . encode ( struct )
8+ def encode ( struct ) do
9+ Protobuf.Encoder . encode_to_iodata ( struct )
1010 end
1111
1212 def decode ( binary , module ) do
Original file line number Diff line number Diff line change 11defmodule GRPC.Compressor do
22 @ callback name ( ) :: String . t ( )
3- @ callback compress ( binary ) :: binary
3+ @ callback compress ( iodata ( ) ) :: binary
44 @ callback decompress ( binary ) :: binary
55end
You can’t perform that action at this time.
0 commit comments