MCPcopy Create free account
hub / github.com/apache/dubbo-rust / set_codec

Method set_codec

remoting/base/src/codec.rs:70–81  ·  view source on GitHub ↗
(
        &mut self,
        protocol: ProtocolName,
        codec: BoxedCodec,
    )

Source from the content-addressed store, hash-verified

68 }
69 }
70 pub fn set_codec(
71 &mut self,
72 protocol: ProtocolName,
73 codec: BoxedCodec,
74 ) -> anyhow::Result<(), CodecError> {
75 if let true = self.registry.contains_key(protocol) {
76 return Err(CodecError::RegistryExistsProtocol(protocol));
77 } else {
78 self.registry.insert(protocol, codec);
79 }
80 Ok(())
81 }
82
83 pub fn is_registered(&self, protocol: ProtocolName) -> bool {
84 self.registry.contains_key(protocol)

Callers 1

test_registryFunction · 0.80

Calls 1

insertMethod · 0.80

Tested by 1

test_registryFunction · 0.64