[fidl] Remove Message::Encode from HLCPP

Message::Encode isn't ever used. Removing it avoids one more potential
usage of coding tables.

Change-Id: I19002185b667e8ed0c22459179a2d992e6f7122b
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/692525
API-Review: Ian McKellar <ianloic@google.com>
Commit-Queue: Benjamin Prosnitz <bprosnitz@google.com>
Reviewed-by: Ian McKellar <ianloic@google.com>
diff --git a/sdk/lib/fidl/cpp/fidl_cpp_base.api b/sdk/lib/fidl/cpp/fidl_cpp_base.api
index c1f1dcd..5b3a5db 100644
--- a/sdk/lib/fidl/cpp/fidl_cpp_base.api
+++ b/sdk/lib/fidl/cpp/fidl_cpp_base.api
@@ -10,7 +10,7 @@
   "pkg/fidl_cpp_base/include/lib/fidl/cpp/internal/bitset.h": "112110f8080e0a5fa560f7e5403f2609",
   "pkg/fidl_cpp_base/include/lib/fidl/cpp/internal/natural_types_header.h": "51d0ec8bbfc111433be204298dbd28c1",
   "pkg/fidl_cpp_base/include/lib/fidl/cpp/internal/natural_types_implementation.h": "78b8e4dfcb074e5fcce2722506c3aaa9",
-  "pkg/fidl_cpp_base/include/lib/fidl/cpp/message.h": "b0d3494eed3ab39860bacca954dbbf41",
+  "pkg/fidl_cpp_base/include/lib/fidl/cpp/message.h": "8afa49edd82f3aad929b308f53bd1698",
   "pkg/fidl_cpp_base/include/lib/fidl/cpp/message_buffer.h": "cb3870d95b861f5d6b5918bf10354e22",
   "pkg/fidl_cpp_base/include/lib/fidl/cpp/message_part.h": "7e16db0daeeaec2565506d21c32c855a",
   "pkg/fidl_cpp_base/include/lib/fidl/cpp/string.h": "3cfb8cc0cfd48900f747456ad0e96b69",
diff --git a/sdk/lib/fidl/cpp/message.cc b/sdk/lib/fidl/cpp/message.cc
index f400ef5..b6c38ee 100644
--- a/sdk/lib/fidl/cpp/message.cc
+++ b/sdk/lib/fidl/cpp/message.cc
@@ -166,16 +166,6 @@
   return *this;
 }
 
-zx_status_t HLCPPOutgoingBody::Encode(const fidl_type_t* type, const char** error_msg_out) {
-  uint32_t actual_handles = 0u;
-  zx_status_t status = fidl_encode_etc(type, bytes_.data(), bytes_.actual(), handles().data(),
-                                       handles().capacity(), &actual_handles, error_msg_out);
-  if (status == ZX_OK)
-    handles().set_actual(actual_handles);
-
-  return status;
-}
-
 zx_status_t HLCPPOutgoingBody::Validate(const internal::WireFormatVersion& wire_format_version,
                                         const fidl_type_t* type, const char** error_msg_out) const {
   zx_status_t status = CheckWireFormatVersion(wire_format_version, type, error_msg_out);
@@ -207,18 +197,6 @@
   return *this;
 }
 
-zx_status_t HLCPPOutgoingMessage::Encode(const fidl_type_t* type, const char** error_msg_out) {
-  uint8_t* trimmed_bytes = bytes_.data();
-  uint32_t trimmed_num_bytes = bytes_.actual();
-  zx_status_t status = ::fidl::internal::fidl_exclude_header_bytes(
-      bytes_.data(), bytes_.actual(), &trimmed_bytes, &trimmed_num_bytes, error_msg_out);
-  if (unlikely(status) != ZX_OK) {
-    return status;
-  }
-
-  return body_view_.Encode(type, error_msg_out);
-}
-
 zx_status_t HLCPPOutgoingMessage::Validate(const fidl_type_t* type,
                                            const char** error_msg_out) const {
   WireFormatMetadata wire_format_metadata = WireFormatMetadata::FromTransactionalHeader(header());
diff --git a/sdk/lib/fidl/cpp/message.h b/sdk/lib/fidl/cpp/message.h
index ecd3054..10357201 100644
--- a/sdk/lib/fidl/cpp/message.h
+++ b/sdk/lib/fidl/cpp/message.h
@@ -247,13 +247,6 @@
     return reinterpret_cast<T*>(bytes_.data());
   }
 
-  // Encodes the message body in-place.
-  //
-  // The message must previously have been in a decoded state, for example,
-  // either by being built in a decoded state using a |Builder| or having been
-  // decoded using the |Decode| method.
-  zx_status_t Encode(const fidl_type_t* type, const char** error_msg_out);
-
   // Validates the message body in-place.
   //
   // The message must already be in an encoded state, for example, either by
@@ -344,13 +337,6 @@
   HandleDispositionPart& handles() { return body_view_.handles(); }
   const HandleDispositionPart& handles() const { return body_view_.handles(); }
 
-  // Encodes the transactional message body in-place.
-  //
-  // The message must previously have been in a decoded state, for example,
-  // either by being built in a decoded state using a |Builder| or having been
-  // decoded using the |Decode| method.
-  zx_status_t Encode(const fidl_type_t* type, const char** error_msg_out);
-
   // Validates the transactional message body in-place.
   //
   // The message must already be in an encoded state, for example, either by