Package org.ldk.structs
Class CustomMessageReader
- java.lang.Object
-
- org.ldk.structs.CustomMessageReader
-
public class CustomMessageReader extends Object
Trait to be implemented by custom message (unrelated to the channel/gossip LN layers) decoders.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CustomMessageReader.CustomMessageReaderInterface
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroys the object, freeing associated resources.protected void
finalize()
static CustomMessageReader
new_impl(CustomMessageReader.CustomMessageReaderInterface arg)
Result_COption_TypeZDecodeErrorZ
read(short message_type, byte[] buffer)
Decodes a custom message to `CustomMessageType`.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
destroy
public void destroy()
Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
-
new_impl
public static CustomMessageReader new_impl(CustomMessageReader.CustomMessageReaderInterface arg)
-
read
public Result_COption_TypeZDecodeErrorZ read(short message_type, byte[] buffer)
Decodes a custom message to `CustomMessageType`. If the given message type is known to the implementation and the message could be decoded, must return `Ok(Some(message))`. If the message type is unknown to the implementation, must return `Ok(None)`. If a decoding error occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
-
-