Method
new
(commits: usize, bytes: usize)
Source from the content-addressed store, hash-verified
| 308 | } |
| 309 | impl GitStreamLimits { |
| 310 | pub fn new(commits: usize, bytes: usize) -> Result<Self, RepositoryError> { |
| 311 | if !(1..=256).contains(&commits) || !(1..=256 * 1024 * 1024).contains(&bytes) { |
| 312 | return Err(invalid( |
| 313 | "stream limits require 1..=256 commits and 1..=256 MiB", |
| 314 | )); |
| 315 | } |
| 316 | Ok(Self { commits, bytes }) |
| 317 | } |
| 318 | pub fn commits(self) -> usize { |
| 319 | self.commits |
| 320 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected