Source code for nix_daemon_protocol.path_info
"""UnkeyedValidPathInfo — store path metadata without the path key."""
from __future__ import annotations
from typing import TYPE_CHECKING
from .content_address import ContentAddress
if TYPE_CHECKING:
from .valid_path_info import ValidPathInfo
from .nar_hash import NARHash
from .signature import Signature
from .store_path import StorePath
from .wire_message import WireField, WireModel
from .wire_time import Time
[docs]
class UnkeyedValidPathInfo(WireModel):
"""Wire mirror of UnkeyedValidPathInfo."""
deriver: StorePath | None = WireField(default=None)
nar_hash: NARHash
references: set[StorePath]
registration_time: Time
nar_size: int
ultimate: bool
sigs: set[Signature]
ca: ContentAddress
[docs]
def to_valid_path_info(self, path: StorePath) -> ValidPathInfo:
"""Wrap this UnkeyedValidPathInfo with a StorePath into ValidPathInfo."""
from .valid_path_info import ValidPathInfo # lazy to avoid circular
return ValidPathInfo(path=path, info=self)