pub struct FtpSpecRegistry {
pub fixtures: Vec<FtpFixture>,
pub vfs: Arc<VirtualFileSystem>,
pub uploads: Arc<RwLock<Vec<UploadRecord>>>,
}Expand description
FTP Spec Registry for MockForge
Fields§
§fixtures: Vec<FtpFixture>§vfs: Arc<VirtualFileSystem>§uploads: Arc<RwLock<Vec<UploadRecord>>>Implementations§
Source§impl FtpSpecRegistry
impl FtpSpecRegistry
pub fn new() -> Self
pub fn with_fixtures(self, fixtures: Vec<FtpFixture>) -> Result<Self>
pub fn with_vfs(self, vfs: Arc<VirtualFileSystem>) -> Self
pub fn find_upload_rule(&self, path: &str) -> Option<&UploadRule>
pub fn record_upload( &self, path: PathBuf, size: u64, rule_name: Option<String>, ) -> Result<String>
pub fn get_uploads(&self) -> Vec<UploadRecord>
pub fn get_upload(&self, id: &str) -> Option<UploadRecord>
Trait Implementations§
Source§impl Clone for FtpSpecRegistry
impl Clone for FtpSpecRegistry
Source§fn clone(&self) -> FtpSpecRegistry
fn clone(&self) -> FtpSpecRegistry
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FtpSpecRegistry
impl Debug for FtpSpecRegistry
Source§impl Default for FtpSpecRegistry
impl Default for FtpSpecRegistry
Source§impl SpecRegistry for FtpSpecRegistry
impl SpecRegistry for FtpSpecRegistry
Source§fn operations(&self) -> Vec<SpecOperation>
fn operations(&self) -> Vec<SpecOperation>
Get all available operations/routes in this spec
Source§fn find_operation(&self, operation: &str, path: &str) -> Option<SpecOperation>
fn find_operation(&self, operation: &str, path: &str) -> Option<SpecOperation>
Find an operation by path/name
Source§fn validate_request(
&self,
request: &ProtocolRequest,
) -> Result<ValidationResult>
fn validate_request( &self, request: &ProtocolRequest, ) -> Result<ValidationResult>
Validate a request against the spec
Source§fn generate_mock_response(
&self,
request: &ProtocolRequest,
) -> Result<ProtocolResponse>
fn generate_mock_response( &self, request: &ProtocolRequest, ) -> Result<ProtocolResponse>
Generate a mock response for a request
Auto Trait Implementations§
impl Freeze for FtpSpecRegistry
impl !RefUnwindSafe for FtpSpecRegistry
impl Send for FtpSpecRegistry
impl Sync for FtpSpecRegistry
impl Unpin for FtpSpecRegistry
impl !UnwindSafe for FtpSpecRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)