/// parameters with static lifetimes). Other times you can afford a reference, which is more
/// efficient, in which case BlockNotifierRef is a more appropriate type. Defining these type
/// aliases prevents issues such as overly long function definitions.
+///
+/// (C-not exported) as we let clients handle any reference counting they need to do
pub type BlockNotifierArc<C> = Arc<BlockNotifier<'static, Arc<ChainListener>, C>>;
/// BlockNotifierRef is useful when you want a BlockNotifier that points to ChainListeners
/// If the same listener is registered multiple times, unregistering
/// will remove ALL occurrences of that listener. Comparison is done using
/// the pointer returned by the Deref trait implementation.
+ ///
+ /// (C-not exported) because the equality check would always fail
pub fn unregister_listener(&self, listener: CL) {
let mut vec = self.listeners.lock().unwrap();
// item is a ref to an abstract thing that dereferences to a ChainListener,
}
/// Converts this OutPoint into the OutPoint field as used by rust-bitcoin
+ /// (C-not exported) as the same type is used universally in the C bindings for all outpoints
pub fn into_bitcoin_outpoint(self) -> BitcoinOutPoint {
BitcoinOutPoint {
txid: self.txid,
}
/// payment_hash type, use to cross-lock hop
+/// (C-not exported) as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentHash(pub [u8;32]);
/// payment_preimage type, use to route payment between hop
+/// (C-not exported) as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentPreimage(pub [u8;32]);
/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together
+/// (C-not exported) as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentSecret(pub [u8;32]);
/// If successful, will generate a UpdateHTLCs event, so you should probably poll
/// PeerManager::process_events afterwards.
/// Note: This API is likely to change!
+ /// (C-not exported) Cause its doc(hidden) anyway
#[doc(hidden)]
pub fn update_fee(&self, channel_id: [u8;32], feerate_per_kw: u32) -> Result<(), APIError> {
let _ = self.total_consistency_lock.read().unwrap();
F::Target: FeeEstimator,
L::Target: Logger,
{
-
/// The keys provider which will give us relevant keys. Some keys will be loaded during
/// deserialization.
pub keys_manager: K,
///
/// In such cases the latest local transactions will be sent to the tx_broadcaster included in
/// this struct.
+ ///
+ /// (C-not exported) because we have no HashMap bindings
pub channel_monitors: HashMap<OutPoint, &'a mut ChannelMonitor<ChanSigner>>,
}
///
/// If you're using this for local monitoring of your own channels, you probably want to use
/// `OutPoint` as the key, which will give you a ManyChannelMonitor implementation.
+///
+/// (C-not exported) due to an unconstrained generic in `Key`
pub struct SimpleManyChannelMonitor<Key, ChanSigner: ChannelKeys, T: Deref, F: Deref, L: Deref, C: Deref>
where T::Target: BroadcasterInterface,
F::Target: FeeEstimator,
/// Gets a list of txids, with their output scripts (in the order they appear in the
/// transaction), which we must learn about spends of via block_connected().
+ ///
+ /// (C-not exported) because we have no HashMap bindings
pub fn get_outputs_to_watch(&self) -> &HashMap<Txid, Vec<Script>> {
&self.outputs_to_watch
}
/// Generally useful when deserializing as during normal operation the return values of
/// block_connected are sufficient to ensure all relevant outpoints are being monitored (note
/// that the get_funding_txo outpoint and transaction must also be monitored for!).
+ ///
+ /// (C-not exported) as there is no practical way to track lifetimes of returned values.
pub fn get_monitored_outpoints(&self) -> Vec<(Txid, u32, &Script)> {
let mut res = Vec::with_capacity(self.remote_commitment_txn_on_chain.len() * 2);
for (ref txid, &(_, ref outputs)) in self.remote_commitment_txn_on_chain.iter() {
/// Tracks the set of features which a node implements, templated by the context in which it
/// appears.
+///
+/// (C-not exported) as we map the concrete feature types below directly instead
pub struct Features<T: sealed::Context> {
/// Note that, for convenience, flags is LITTLE endian (despite being big-endian on the wire)
flags: Vec<u8>,
/// As we wish to serialize these differently from Option<T>s (Options get a tag byte, but
/// OptionalFeild simply gets Present if there are enough bytes to read into it), we have a
/// separate enum type for them.
+/// (C-not exported) due to a free generic in T
#[derive(Clone, PartialEq, Debug)]
pub enum OptionalField<T> {
/// Optional field is included in message
impl NetworkGraph {
/// Returns all known valid channels' short ids along with announced channel info.
+ ///
+ /// (C-not exported) because we have no mapping for `BTreeMap`s
pub fn get_channels<'a>(&'a self) -> &'a BTreeMap<u64, ChannelInfo> { &self.channels }
/// Returns all known nodes' public keys along with announced node info.
+ ///
+ /// (C-not exported) because we have no mapping for `BTreeMap`s
pub fn get_nodes<'a>(&'a self) -> &'a BTreeMap<PublicKey, NodeInfo> { &self.nodes }
/// Get network addresses by node id.
/// Returns None if the requested node is completely unknown,
/// or if node announcement for the node was never received.
+ ///
+ /// (C-not exported) as there is no practical way to track lifetimes of returned values.
pub fn get_addresses<'a>(&'a self, pubkey: &PublicKey) -> Option<&'a Vec<NetAddress>> {
if let Some(node) = self.nodes.get(pubkey) {
if let Some(node_info) = node.announcement_info.as_ref() {
/// A Record, unit of logging output with Metadata to enable filtering
/// Module_path, file, line to inform on log's source
+/// (C-not exported) - we convert to a const char* instead
#[derive(Clone,Debug)]
pub struct Record<'a> {
/// The verbosity level of the message.
impl<'a> Record<'a> {
/// Returns a new Record.
+ /// (C-not exported) as fmt can't be used in C
#[inline]
pub fn new(level: Level, args: fmt::Arguments<'a>, module_path: &'a str, file: &'a str, line: u32) -> Record<'a> {
Record {
/// buffers being written into.
/// An impl is provided for any type that also impls std::io::Write which simply ignores size
/// hints.
+///
+/// (C-not exported) as we only export serialization to/from byte arrays instead
pub trait Writer {
/// Writes the given buf out. See std::io::Write::write_all for more
fn write_all(&mut self, buf: &[u8]) -> Result<(), ::std::io::Error>;
}
/// A trait that various rust-lightning types implement allowing them to be written out to a Writer
+///
+/// (C-not exported) as we only export serialization to/from byte arrays instead
pub trait Writeable {
/// Writes self out to the given Writer
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), ::std::io::Error>;
}
/// A trait that various rust-lightning types implement allowing them to be read in from a Read
+///
+/// (C-not exported) as we only export serialization to/from byte arrays instead
pub trait Readable
where Self: Sized
{
/// A trait that various higher-level rust-lightning types implement allowing them to be read in
/// from a Read given some additional set of arguments which is required to deserialize.
+///
+/// (C-not exported) as we only export serialization to/from byte arrays instead
pub trait ReadableArgs<P>
where Self: Sized
{
}
/// A trait that various rust-lightning types implement allowing them to (maybe) be read in from a Read
+///
+/// (C-not exported) as we only export serialization to/from byte arrays instead
pub trait MaybeReadable
where Self: Sized
{