Implement the encrypt function in Rust to handle a text transformation as specified by the following requirements:
Input Processing:
Take a string input consisting of ASCII characters, which may include spaces and punctuation.
Ignore all non-ASCII characters during processing.
Text Normalization:
Convert all characters in the input string to lowercase.
Remove any punctuation from the input.
Treat spaces as separators and ignore leading, trailing, and excess intermediate whitespace.
Square Transformation:
Envision the cleaned text as a rectangular grid. The output should be formatted as a sequence of words formed by reading the columns of this grid.
The length of the grid's rows can be determined by finding the smallest integer n such that n*n is greater than or equal to the length of the cleaned string. The resulting grid should be of n rows.
Word Construction:
Read the grid column by column and concatenate the characters into resultant words, preserving the order of columns.
Return the final output as a single string with spaces between the words.
Tests:
The function must pass all defined tests:
For an empty input, return an empty string.
For inputs with spaces, reorganize them into a consistent format.
Ensure that punctuation does not affect the output.
Confirm that the encrypt function can reverse its output if the conditions hold true (no punctuation, even spacing, all lowercase, and square input).
The solution should be placed in the /app/ directory in a Rust file named lib.rs.