libp2p/protocols/pubsub/timedcache

    Dark Mode
Search:
Group by:
  Source   Edit

Types

TimedCache[K] = object of RootObj
  head, tail: TimedEntry[K]
  entries: HashSet[TimedEntry[K]]
  timeout: Duration
  maxSize: int
  Source   Edit
TimedEntry[K] = ref object of RootObj
  key: K
  addedAt: Moment
  expiresAt: Moment
  next, prev: TimedEntry[K]
  Source   Edit

Consts

Timeout = (value: 10000000000)
  Source   Edit

Procs

func `==`[E](a, b: TimedEntry[E]): bool {....raises: [].}
  Source   Edit
func addedAt[K](t: var TimedCache[K]; k: K): Moment {....raises: [].}
  Source   Edit
func contains[K](t: TimedCache[K]; k: K): bool {....raises: [].}
  Source   Edit
func del[K](t: var TimedCache[K]; key: K): Opt[TimedEntry[K]] {....raises: [].}
  Source   Edit
func expire(t: var TimedCache; now: Moment = Moment.now()) {....raises: [].}
  Source   Edit
func hash(a: TimedEntry): Hash {....raises: [].}
  Source   Edit
func init[K](T: type TimedCache[K]; timeout: Duration = Timeout;
             maxSize: int = 0): T:type {....raises: [].}
  Source   Edit
func put[K](t: var TimedCache[K]; k: K; now = Moment.now()): bool {....raises: [].}
  Source   Edit