Relation Between Structure and Diffusion in Nanostructured Porous Solids and in Lipid Membranes