% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/40-priority_queue-indexing.R
\name{sub-.priority_queue}
\alias{sub-.priority_queue}
\alias{[.priority_queue}
\alias{[[.priority_queue}
\alias{[<-.priority_queue}
\alias{[[<-.priority_queue}
\alias{$.priority_queue}
\alias{$<-.priority_queue}
\title{Indexing for Priority Queues}
\usage{
\method{[}{priority_queue}(x, i, ...)

\method{[[}{priority_queue}(x, i, ...)

\method{[}{priority_queue}(x, i) <- value

\method{[[}{priority_queue}(x, i) <- value

\method{$}{priority_queue}(x, name)

\method{$}{priority_queue}(x, name) <- value
}
\arguments{
\item{x}{A \code{priority_queue}.}

\item{i}{Index input. For reads, must be a character name (scalar for \code{[[}).}

\item{...}{Unused.}

\item{value}{Replacement value (unsupported).}

\item{name}{Element name (for \code{$} and \verb{$<-}).}
}
\value{
For \code{$}/\code{[[}/\code{[}: queue payload values or queue subsets by name.
Replacement forms always error.
}
\description{
Name-based indexing is supported for reads only. Positional indexing and all
replacement indexing are intentionally blocked to preserve queue-first UX.
}
\details{
\code{priority_queue} supports name-based read indexing only.
\itemize{
\item \code{[}: character vector of names, returns a \code{priority_queue} subset.
\item \code{[[} and \code{$}: scalar name, return the payload value.
\item Positional indexing and all replacement indexing forms are unsupported.
}
}
\examples{
q <- priority_queue(a = "task-a", b = "task-b", priorities = c(2, 1))

q["a"]
q[["b"]]
q$b

try(q[1])
try(q$a <- "updated")
}
