pub fn with_programs_at_uri<ProgramResponse: response::IntoDocumentResponse>(
        &self,
        uri: &Url,
        callback: impl Fn(&Program) -> Option<ProgramResponse>,
    ) -> Option<Vec<ProgramResponse::DocumentResponse>> {
        let document = self.document(uri)?;

        // Get the program-level responses and marshal back to document-level responses.
        let to_position = |offset| document.source_map.to_position(offset);
        let document_response = document
            .programs
            .iter()
            .filter_map(|program| callback(program).map(|r| (r, program.start)))
            .map(|(program_response, program_offset)| {
                program_response.into_document_response(program_offset, &to_position)
            })
            .collect();
        Some(document_response)
    }
/// Like [`with_program_at_uri_and_position`](Self::with_program_at_uri_and_position), but works
/// on all [`Program`](Program)s in the document corresponding to the `uri`.
///
/// Returns a `Vec` of responses, each response corresponding to a `Program` in the document.
/// `Program`s returning an empty response are dropped, and linear order of `Program` response
/// is not guaranteed.


Returns a `Vec` of responses, each response corresponding to a `Program` in the document.
`Program`s returning an empty response are dropped, and linear order of `Program` response
is not guaranteed.
Returns a ` Vec ` of responses each response corresponding to a ` Program ` in the document . ` Program ` s returning an empty response are dropped and linear order of ` Program ` response is not guaranteed .
pub fn with_programs_at_uri<ProgramResponse: response::IntoDocumentResponse>(
        &self,
        uri: &Url,
        callback: impl Fn(&Program) -> Option<ProgramResponse>,
    ) -> Option<Vec<ProgramResponse::DocumentResponse>> {
        let document = self.document(uri)?;
        // Get the program-level responses and marshal back to document-level responses.
        let to_position = |offset| document.source_map.to_position(offset);
        let document_response = document
            .programs
            .iter()
            .filter_map(|program| callback(program).map(|r| (r, program.start)))
            .map(|(program_response, program_offset)| {
                program_response.into_document_response(program_offset, &to_position)
            })
            .collect();
        Some(document_response)
    }
pub fn with_programs_at_uri < ProgramResponse : response :: IntoDocumentResponse > ( & self , uri : & Url , callback : impl Fn ( & Program ) -> Option < ProgramResponse > , ) -> Option < Vec < ProgramResponse :: DocumentResponse > > { let document = self . document ( uri ) ? ; // Get the program-level responses and marshal back to document-level responses. let to_position = | offset | document . source_map . to_position ( offset ) ; let document_response = document . programs . iter ( ) . filter_map ( | program | callback ( program ) . map ( | r | ( r , program . start ) ) ) . map ( | ( program_response , program_offset ) | { program_response . into_document_response ( program_offset , & to_position ) } ) . collect ( ) ; Some ( document_response ) }
Like [`with_program_at_uri_and_position`](Self::with_program_at_uri_and_position), but works
on all [`Program`](Program)s in the document corresponding to the `uri`.
Like [ ` with_program_at_uri_and_position ` ] ( Self :: with_program_at_uri_and_position ) but works on all [ ` Program ` ] ( Program ) s in the document corresponding to the ` uri ` .
&self
uri
&Url
callback
impl Fn(&Program) -> Option<ProgramResponse>
&self
uri
&Url
callback
impl Fn(&Program) -> Option<ProgramResponse>