From 367633a00a0a24775a09a54d837dd0a407310aaf Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Thu, 18 Feb 2021 14:11:47 -0800 Subject: [PATCH] feat(core): add Arguments::positional, returns an iterator over positional parameters --- sqlx-core/src/arguments.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sqlx-core/src/arguments.rs b/sqlx-core/src/arguments.rs index ee518191..fdb5dc14 100644 --- a/sqlx-core/src/arguments.rs +++ b/sqlx-core/src/arguments.rs @@ -108,6 +108,11 @@ impl<'a, Db: Database> Arguments<'a, Db> { self.positional.len() } + /// Returns an iterator of the positional parameters. + pub fn positional(&self) -> impl Iterator> { + self.positional.iter() + } + /// Returns a reference to the argument at the location, if present. pub fn get<'x, I: ArgumentIndex<'a, Db>>(&'x self, index: &I) -> Option<&'x Argument<'a, Db>> { index.get(self)