ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.VolatileDB.Impl.Index

Description

VolatileDB Index

Intended for qualified import > import qualified Ouroboros.Consensus.Storage.VolatileDB.Impl.Index as Index

Synopsis

Documentation

data Index blk Source #

Mapping from FileId to FileInfo

Instances

Instances details
Generic (Index blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Index

Associated Types

type Rep (Index blk) :: Type -> Type #

Methods

from :: Index blk -> Rep (Index blk) x #

to :: Rep (Index blk) x -> Index blk #

StandardHash blk => NoThunks (Index blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Index

type Rep (Index blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Index

type Rep (Index blk) = D1 ('MetaData "Index" "Ouroboros.Consensus.Storage.VolatileDB.Impl.Index" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'True) (C1 ('MetaCons "Index" 'PrefixI 'True) (S1 ('MetaSel ('Just "unIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntMap (FileInfo blk)))))

lookup :: FileId -> Index blk -> Maybe (FileInfo blk) Source #

insert :: FileId -> FileInfo blk -> Index blk -> Index blk Source #

delete :: FileId -> Index blk -> Index blk Source #

toAscList :: Index blk -> [(FileId, FileInfo blk)] Source #

elems :: Index blk -> [FileInfo blk] Source #

lastFile :: Index blk -> Maybe (FileId, FileInfo blk) Source #

Return the last, i.e. the highest, FileId and corresponding FileInfo stored in the Index. Return Nothing when empty.