(a) By the Government. The government may, with leave of court, dismiss an indictment, information, or complaint. The government may not dismiss the prosecution during trial without the defendant's consent.
(b) By the Court. The court may dismiss an indictment, information, or complaint if unnecessary delay occurs in:
(1) presenting a charge to a grand jury;
(2) filing an information against a defendant; or
(3) bringing a defendant to trial.